Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在GitHub操作中上载工件_Github_Github Actions - Fatal编程技术网

在GitHub操作中上载工件

在GitHub操作中上载工件,github,github-actions,Github,Github Actions,如何更新以下代码,使工件包含一个名为“Scripts”的文件夹,并将所有文件复制到“Scripts”文件夹 - name: copy scripts run: Copy 'Scripts/' '${{ github.workspace }}/Scripts' shell: powershell - name: publish artifact uses: actions/upload-artifact@v2 with: path

如何更新以下代码,使工件包含一个名为“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 }}

只需在您的工件和所需文件之间创建一个文件夹

谢谢!尝试此操作后,显示错误:未找到具有所提供路径的文件:D:\a\gmm build\gmm build/Artifacts。不会上载任何工件。其他步骤有效吗?我不确定这是否是创建文件夹的正确方法(我还编写了一个事实,而不是
工件)
构建成功。但是,我没有看到“工件”文件夹。我修复了输入错误,但仍然不起作用。我尝试将步骤更新为:run:|mkdir-p${{github.workspace}}}/Artifacts,并使用您的步骤复制和发布。但这会产生错误:警告:未找到具有所提供路径的文件:D:\a\gmm build\gmm build/Artifacts。不会上载任何工件。您是否找到解决方案?