Skip to content

[ci] Fix docs validation notification: use Jobs API instead of artifacts#18050

Closed
theletterf wants to merge 2 commits intomainfrom
ci/fix-docs-validation-notify
Closed

[ci] Fix docs validation notification: use Jobs API instead of artifacts#18050
theletterf wants to merge 2 commits intomainfrom
ci/fix-docs-validation-notify

Conversation

@theletterf
Copy link
Copy Markdown
Member

Summary

Fixes the notification workflow that was failing to post comments because download-artifact@v4 can't access artifacts across workflow runs.

What changed

notify-package-docs-failure.yml — replaced the artifact download approach with the Jobs API:

  1. Queries GET /repos/{repo}/actions/runs/{id}/jobs to check if the "Validate with docs-builder" step concluded as failure
  2. Finds the PR number from the head SHA via the commits API
  3. Posts the comment if both conditions are met

validate-package-docs.yml — removed the signal/upload artifact steps (no longer needed).

Why the artifact approach failed

upload-artifact@v4 scopes artifacts to the workflow run that created them. download-artifact@v4 in a workflow_run-triggered workflow can't access them even with the run-id parameter, resulting in Artifact 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

@theletterf theletterf requested a review from a team as a code owner March 25, 2026 16:08
Comment thread .github/workflows/notify-package-docs-failure.yml Outdated
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>
@theletterf theletterf force-pushed the ci/fix-docs-validation-notify branch from 9be4d43 to cd268c9 Compare March 25, 2026 16:27
@elastic elastic deleted a comment from cla-checker-service bot Mar 25, 2026
@cla-checker-service
Copy link
Copy Markdown

❌ Author of the following commits did not sign a Contributor Agreement:
cd268c9

Please, read and sign the above mentioned agreement if you want to contribute to this project

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