Github 操作对 .net git Restore buld 使用存储库名称两次
鉴于此工作流程和代码目录
Repo:RepoName
.github/workflow/workflow.file
.git
Src/Demo/Demo.csproj
Test
Demo.Sln
此工作流程在执行 dotnet 恢复时使用两次 RepoName 的恢复命令失败
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/work/RepoName/RepoName/PaymentGateway.sln]
的变体
- 尝试了dotnet Restore 'Demo.sln'
- dotnet Restore '/Demo.sln'
- dotnet Restore '**/Demo.sln'
Given this workflow and Code directory
Repo: RepoName
.github/workflow/workflow.file
.git
Src/Demo/Demo.csproj
Test
Demo.Sln
This workflow fails on the restore command with RepoName used twice when doing dotnet 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
Error received: /home/runner/.dotnet/sdk/5.0.406/NuGet.targets(290,5): error MSB3202: The project file "/home/runner/work/RepoName/RepoName/Src/WebApi/WebApi.csproj" was not found. [/home/runner/work/RepoName/RepoName/PaymentGateway.sln]
Tried variations of
- dotnet restore 'Demo.sln'
- dotnet restore '/Demo.sln'
- dotnet restore '**/Demo.sln'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是正确的行为。
我做到了
,它揭示了某些代码不在该分支机构中
This is the correct behaviour.
I did
and it revealed that some code were not in that branch