在GitHub Action中上传工件 [英] upload artifact in GitHub Action
本文介绍了在GitHub Action中上传工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更新以下代码,以使工件包含名为脚本"的文件夹,并将所有文件复制到脚本"文件夹?
How do I update the following code so that artifact contains a folder named 'Scripts' and all the files are copied to 'Scripts' folder?
- name: copy scripts
run: Copy 'Scripts/' '${{ github.workspace }}/Scripts'
shell: powershell
- name: publish artifact
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/Scripts
name: ${{ github.run_number }}
推荐答案
您可以使用此
- name: Create Artifact Folder
run: New-Item -Path '${{ github.workspace }}' -Name "Artifacts" -ItemType "directory"
shell: powershell
- name: Copy Scripts
run: Copy 'Scripts/' '${{ github.workspace }}/Artifacts/Scripts'
shell: powershell
- name: Publish Artifact
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/Artifacts
name: ${{ github.run_number }}
只需在您的工件和所需文件之间创建一个文件夹
Just create a folder between your artifact and your desired files
这篇关于在GitHub Action中上传工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文