簡體   English   中英

在 GitHub Action 中上傳工件

[英]upload artifact in GitHub Action

如何更新以下代碼,以便工件包含名為“Scripts”的文件夾並將所有文件復制到“Scripts”文件夾?

 - 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 }}

只需在您的工件和所需文件之間創建一個文件夾

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM