[ci] Fix docs validation notification: use Jobs API instead of artifacts#18050
Closed
theletterf wants to merge 2 commits intomainfrom
Closed
[ci] Fix docs validation notification: use Jobs API instead of artifacts#18050theletterf wants to merge 2 commits intomainfrom
theletterf wants to merge 2 commits intomainfrom
Conversation
The artifact-based approach doesn't work because upload-artifact@v4 scopes artifacts to the workflow run, making them inaccessible from a workflow_run-triggered workflow via download-artifact. Instead, query the Jobs API to check if the "Validate with docs-builder" step concluded as failure (despite the job succeeding via continue-on-error), and find the PR number from the head SHA. Also removes the now-unnecessary signal/upload steps from the validation workflow. Handles jq returning literal "null" for commits without a PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9be4d43 to
cd268c9
Compare
|
❌ Author of the following commits did not sign a Contributor Agreement: Please, read and sign the above mentioned agreement if you want to contribute to this project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the notification workflow that was failing to post comments because
download-artifact@v4can't access artifacts across workflow runs.What changed
notify-package-docs-failure.yml— replaced the artifact download approach with the Jobs API:GET /repos/{repo}/actions/runs/{id}/jobsto check if the "Validate with docs-builder" step concluded asfailurevalidate-package-docs.yml— removed the signal/upload artifact steps (no longer needed).Why the artifact approach failed
upload-artifact@v4scopes artifacts to the workflow run that created them.download-artifact@v4in aworkflow_run-triggered workflow can't access them even with therun-idparameter, resulting inArtifact not found.The Jobs API approach is simpler and doesn't require any coordination between the two workflows — it just inspects the step outcomes directly.
🤖 Generated with Claude Code