Skip to content

Commit

Permalink
Add github.token to actions/download-artifact
Browse files Browse the repository at this point in the history
The addition of workflow_run.id in #67 wasn't enough. Tracing through
the dorny/test-reporter code, I found that it was grabbing github.token
as well. The actions/download-artifact README documentation now makes
more sense:

```yaml
  # The GitHub token used to authenticate with the GitHub API. This is
  # required when downloading artifacts from a different repository or
  # from a different workflow run.
  # Optional. If unspecified, the action will download artifacts from
  # the current repo and the current workflow run.
  github-token:

  # The id of the workflow run where the desired download artifact was
  # uploaded from. If github-token is specified, this is the run that
  # artifacts will be downloaded from.
  # Optional. Default is ${{ github.run_id }}
  run-id:
```

Basically, I think both are needed here, based on what
dorny/test-reporter appears to be doing.
  • Loading branch information
mbland committed Dec 19, 2023
1 parent b059aac commit fd028e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-test-results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: test-results
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Post test report
Expand Down

0 comments on commit fd028e3

Please sign in to comment.