unggah artefak di GitHub Action

Sep 23 2020

Bagaimana cara memperbarui kode berikut sehingga artefak berisi folder bernama 'Scripts' dan semua file disalin ke folder '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 }}

Jawaban

ItayBrenner Sep 23 2020 at 23:00

Anda dapat menggunakan ini:

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

Cukup buat folder antara artefak Anda dan file yang Anda inginkan