อัปโหลดอาร์ติแฟกต์ใน GitHub Action

Sep 23 2020

ฉันจะอัปเดตโค้ดต่อไปนี้ได้อย่างไรเพื่อให้อาร์ติแฟกต์มีโฟลเดอร์ชื่อ 'สคริปต์' และไฟล์ทั้งหมดจะถูกคัดลอกไปยังโฟลเดอร์ 'สคริปต์'

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

คำตอบ

ItayBrenner Sep 23 2020 at 23:00

คุณสามารถใช้สิ่งนี้:

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

เพียงสร้างโฟลเดอร์ระหว่างสิ่งประดิษฐ์และไฟล์ที่คุณต้องการ