dawidd6 / action-download-artifact

:gear: A GitHub Action to download an artifact associated with given workflow and commit or other criteria
MIT License
705 stars 203 forks source link

How to get artifact from CI action of merged branch? #198

Open jamesBennett opened 1 year ago

jamesBennett commented 1 year ago

Here's my download

        uses: dawidd6/action-download-artifact@v2
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          workflow: ci.yml
          commit: ${{ github.event.pull_request.head.sha }}
          name: artifactKey
          path: ./manifest

This just seems to grab the last artifact created despite a merge or branch.

dawidd6 commented 1 year ago

I don't understand the problem. Please elaborate.

cassandracomar commented 1 month ago

the calling workflow needs to be triggered by a pull_request_target event in order for this to work. github.event.pull_request isn't set for push events.