问题
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 }}
回答1:
You can use this:
- 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
来源:https://stackoverflow.com/questions/64037059/upload-artifact-in-github-action