Github 操作为 .net 使用 repo 名称两次 git 恢复构建
Github action use repo name twice for .net git restore buld
鉴于此工作流程和代码目录
回购:回购名称
.github/workflow/workflow.file
.git
Src/Demo/Demo.csproj
Test
Demo.Sln
在执行 dotnet restore 时,此工作流在使用 RepoName 两次的 restore 命令上失败
name: Demo
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
on:
push:
paths:
- 'Src/**'
- 'Tests/**'
- 'Demo.sln'
- '**/demo-workflow.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Restore NuGet packages
run: dotnet restore
收到错误:/home/runner/.dotnet/sdk/5.0.406/NuGet.targets(290,5):错误 MSB3202:项目文件“/home/runner/work/RepoName/RepoName/Src/WebApi/WebApi.csproj" 未找到。 [/home/runner/工作/RepoName/RepoName/PaymentGateway.sln]
尝试了
的变体
- dotnet 恢复 'Demo.sln'
- dotnet 恢复'/Demo.sln'
- dotnet 恢复'**/Demo.sln'
这是正确的行为。
我做到了
run: |
ls ${{github.workspace}}
并且它显示某些代码不在该分支中
鉴于此工作流程和代码目录
回购:回购名称
.github/workflow/workflow.file
.git
Src/Demo/Demo.csproj
Test
Demo.Sln
在执行 dotnet restore 时,此工作流在使用 RepoName 两次的 restore 命令上失败
name: Demo
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
on:
push:
paths:
- 'Src/**'
- 'Tests/**'
- 'Demo.sln'
- '**/demo-workflow.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Restore NuGet packages
run: dotnet restore
收到错误:/home/runner/.dotnet/sdk/5.0.406/NuGet.targets(290,5):错误 MSB3202:项目文件“/home/runner/work/RepoName/RepoName/Src/WebApi/WebApi.csproj" 未找到。 [/home/runner/工作/RepoName/RepoName/PaymentGateway.sln]
尝试了
的变体- dotnet 恢复 'Demo.sln'
- dotnet 恢复'/Demo.sln'
- dotnet 恢复'**/Demo.sln'
这是正确的行为。
我做到了
run: |
ls ${{github.workspace}}
并且它显示某些代码不在该分支中