Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/GnuComment.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thoughts, would it make more sense to only run this workflow if the previous workflow succeeded, i.e.:

if: ${{ github.event.workflow_run.conclusion == 'success' }}

https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should restrict it to conclusion == 'success'. When a PR introduces GNU test failures or regressions, GnuTests intentionally exits with code 1 (failure), but it uploads the comment artifact via if: success() || failure() so GnuComment can still report the diff to the PR. If we require success, we wouldn't get comments on failing runs where the report is most needed.

The artifact is only missing when GnuTests fails early before reaching the comparison step (or is cancelled), which is why checking if (!matchArtifact) matches SizeComment and gracefully handles that case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right, although we can at least exclude cancelled workflows by adding:

if: |
  github.event.workflow_run.conclusion == 'success' ||
  github.event.workflow_run.conclusion == 'failure'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Added the condition to ensure we only trigger when the workflow conclusion is
either success or failure.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:

runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request'
github.event.workflow_run.event == 'pull_request' &&
(github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure')
steps:
- name: 'Download artifact'
uses: actions/github-script@v9
Expand All @@ -34,6 +36,10 @@ jobs:
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "comment"
})[0];
if (!matchArtifact) {
core.info("No comment artifact found; skipping.");
return;
}
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
Loading