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 workflow_run.id to actions/download-artifact #67

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

mbland
Copy link
Owner

@mbland mbland commented Dec 19, 2023

The addition of actions/download-artifact@v4 to
publish-test-results.yaml in #66 still failed:

What was interesting was the run-id: value from the "Download test results" step:

  Run actions/download-artifact@v4
    with:
      name: test-results
      merge-multiple: false
      repository: mbland/tomcat-servlet-testing-example
      run-id: 7267779677
  Downloading single artifact
  Error: Unable to download artifact(s): Artifact not found for name:
    test-results

followed by this line from "Post test report":

  Action was triggered by workflow_run: using SHA and RUN_ID from
  triggering workflow

So this change attempts to fix the breakage by adding github.event.workflow_run.id to the actions/download-artifact configuration.

The addition of actions/download-artifact@v4 to
publish-test-results.yaml in #66 still failed:

- https://github.com/mbland/tomcat-servlet-testing-example/actions/runs/7267779677/job/19802307107

What was interesting was the `run-id:` value from the "Download test
results" step:

  Run actions/download-artifact@v4
    with:
      name: test-results
      merge-multiple: false
      repository: mbland/tomcat-servlet-testing-example
      run-id: 7267779677
  Downloading single artifact
  Error: Unable to download artifact(s): Artifact not found for name:
    test-results

followed by this line from "Post test report":

  Action was triggered by workflow_run: using SHA and RUN_ID from
  triggering workflow

So this change attempts to fix the breakage by adding
`github.event.workflow_run.id` to the actions/download-artifact
configuration.
@mbland mbland self-assigned this Dec 19, 2023
@mbland
Copy link
Owner Author

mbland commented Dec 19, 2023

As with #66, the publish-test-results.yaml changes don't appear to have taken effect in the same PR that introduced them. Force merging and monitoring main again.

@mbland mbland merged commit b059aac into main Dec 19, 2023
2 checks passed
@mbland mbland deleted the fix-download-artifact branch December 19, 2023 21:54
mbland added a commit that referenced this pull request 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:

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