【发布时间】:2021-09-19 19:48:09
【问题描述】:
我正在通过这些最后步骤在非主分支上设置 CI 定义:
- name: Zip the release
uses: papeloto/action-zip@v1
with:
files: README.md LICENSE *.dll nfive.yml nfive.lock fxmanifest.lua index.html config/
dest: ${{ github.workspace }}\nfive.zip
- name: Attach Zip as build artifact
uses: actions/upload-artifact@v1
with:
name: nfive
path: ${{ github.workspace }}\nfive.zip
为什么 github.workspace 指向原始存储库 NFive\NFive?
所以,如果运行 echo ${{ github.workspace }} 它肯定会显示父存储库,但是如果我将目录更改为我的组织名称和分叉存储库名称,这会变得更加困难,我会得到:
这是这些步骤的输出:
- run: echo ${{ github.workspace }}
- name: Move files to artifact folder
shell: pwsh
run: |
cd D:\a\HTB-5M\NFive
mkdir Build
Move-Item -Path README.md,LICENSE,*.dll,nfive.yml,nfive.lock,fxmanifest.lua,index.html,config -Destination Build
因为我不是贡献者,所以我无权访问父路径,这就是我首先分叉的原因,那么为什么 Github 假设 github.workspace 应该映射到父路径?
=== Udate ===
所以我重新分配到我的用户帐户而不是我使用的组织,并添加了一个工作流步骤来仅显示 github.workspace 变量,它肯定表示父工作区 D:\a\NFive\NFive
我尝试更改 nfive.yml 中的路径
同样的结果
删除 nfive.yml 不会改变任何东西。我认为 nfive.yml 实际上是在 CI / CD 管道中使用的原始作者在 appveyor 上配置的,因此它不会影响这里的任何内容。
【问题讨论】:
标签: github-actions