Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github.token to actions/download-artifact #68

Merged
merged 1 commit into from
Dec 19, 2023
Merged

Conversation

mbland
Copy link
Owner

@mbland mbland commented Dec 19, 2023

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:

  # 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.

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.
@mbland mbland self-assigned this Dec 19, 2023
@mbland
Copy link
Owner Author

mbland commented Dec 19, 2023

As with #66 and #67, force merging due to publish-test-results.yaml changes not getting picked up in the same PR that updates it.

@mbland mbland merged commit dc4f4fa into main Dec 19, 2023
2 checks passed
@mbland mbland deleted the fix-download-artifact branch December 19, 2023 22:26
mbland added a commit that referenced this pull request Dec 19, 2023
The overall "Publish Test Results" run for #68 failed, but _after_ that
change caused the "Download test results" step to pass:

- https://github.com/mbland/tomcat-servlet-testing-example/actions/runs/7268307692/job/19803882107

Tracing through the code, it seems that dorny/test-reporter does the
following:

- When `artifact:` is specified, it will check out the repo at
  github.event.workflow_run.head_commit.id.
- When `artifact:` is _not_ specified, it assumes the repo is already
  present.

This should, hopefully, provide the last missing piece for the test
reporter to run successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant