操作不复制整个子文件夹

Actions dont copy the entire subfolder

我正在尝试使用 msbuild 并使用以下工作流程来构建我的灵魂


on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  # Path to the solution file relative to the root of the project.
  SOLUTION_FILE_PATH: ./genshincheat.sln

  # Configuration type to build.
  # You can convert this to a build matrix if you need coverage of multiple configuration types.
  # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  BUILD_CONFIGURATION: Release

permissions:
  contents: read

jobs:
  build:
    runs-on: windows-2022
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: actions/setup-dotnet@v1
      - name: Build
        run: dotnet build
      - name: Run tests
        run: dotnet test

运行msbuild命令时出现问题:-

Build FAILED.

D:\a\genshin-cheat\genshin-cheat\injector\injector.vcxproj : warning NU1503: Skipping restore for project 'D:\a\genshin-cheat\genshin-cheat\injector\injector.vcxproj'. The project file may be invalid or missing targets required for restore. [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
D:\a\genshin-cheat\genshin-cheat\cheat-base\cheat-base.vcxproj : warning NU1503: Skipping restore for project 'D:\a\genshin-cheat\genshin-cheat\cheat-base\cheat-base.vcxproj'. The project file may be invalid or missing targets required for restore. [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
D:\a\genshin-cheat\genshin-cheat\cheat-library\cheat-library.vcxproj : warning NU1503: Skipping restore for project 'D:\a\genshin-cheat\genshin-cheat\cheat-library\cheat-library.vcxproj'. The project file may be invalid or missing targets required for restore. [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
C:\Program Files\dotnet\sdk.0.202\NuGet.targets(130,5): warning : Unable to find a project to restore! [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
D:\a\genshin-cheat\genshin-cheat\cheat-base\cheat-base.vcxproj(25,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
D:\a\genshin-cheat\genshin-cheat\cheat-library\cheat-library.vcxproj(757,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
D:\a\genshin-cheat\genshin-cheat\injector\injector.vcxproj(39,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
    4 Warning(s)
    3 Error(s)

Time Elapsed 00:00:12.01
Error: Process completed with exit code 1.

我想这是因为提到的文件不存在 我的仓库有一个解决方案文件和 3 个子文件夹。在错误“cheat-base\cheat-base.vcxproj(25,3)”中丢失,所以我想其中一个子文件夹,即 cheat-base 没有被克隆。有什么解决办法吗?

向子文件夹添加 recursive 而不是 true 解决了这个问题