user989988
user989988

Reputation: 3736

GitHub actions to copy files to GitHub Workspace

I have a few steps to copy some folders from source code to GitHub WorkSpace as shown below. On running this build I see

Warning: No files were found with the provided path: ${GITHUB_WORKSPACE}. No artifacts will be uploaded.

I checked and confirmed that both folders are not empty. What am I missing?

   - name: copy arm templates
      run: Copy 'Infrastructure/' '${GITHUB_WORKSPACE}/Infrastructure'
      shell: powershell
      
    - name: copy release management scripts
      run: Copy 'Scripts/' '${GITHUB_WORKSPACE}/Scripts'
      shell: powershell
      
    - name: publish artifact
      uses: actions/upload-artifact@v2
      with:
        path: ${GITHUB_WORKSPACE}
        name: ${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}
  

Upvotes: 12

Views: 18831

Answers (1)

riQQ
riQQ

Reputation: 12693

Your syntax for using expressions and the GitHub actions context is wrong (reference: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions).

Use ${{ github.workspace }} instead of ${GITHUB_WORKSPACE}

    - name: publish artifact
      uses: actions/upload-artifact@v2
      with:
        path: ${{ github.workspace }}
        name: ${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}

Upvotes: 22

Related Questions