Skip to content

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

Merged
theletterf merged 1 commit intomainfrom
ci/fix-docs-validation-notify-v2
Mar 25, 2026
Merged

[ci] Fix docs validation notification: use Jobs API instead of artifacts#18052
theletterf merged 1 commit intomainfrom
ci/fix-docs-validation-notify-v2

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.

Replaces #18050 (CLA failure due to bot commit in history).

What changed

notify-package-docs-failure.yml — replaced the artifact download 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 (handles jq null output)
  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, resulting in Artifact not found.

🤖 Generated with Claude Code

@theletterf theletterf requested a review from a team as a code owner March 25, 2026 16:29
@cla-checker-service
Copy link
Copy Markdown

cla-checker-service bot commented Mar 25, 2026

💚 CLA has been signed

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-v2 branch from 9f99938 to 6e3653c Compare March 25, 2026 16:31
@theletterf theletterf merged commit 11469b3 into main Mar 25, 2026
8 of 9 checks passed
@theletterf theletterf deleted the ci/fix-docs-validation-notify-v2 branch March 25, 2026 16:37
theletterf added a commit that referenced this pull request Mar 25, 2026
…cts (#18052)

The artifact-based notification couldn't detect failures because
upload-artifact@v4 scopes artifacts to their workflow run.

Instead, download the workflow logs via the API and grep for
docs-builder's summary line (N Errors / N Warnings) to detect
failures even with continue-on-error.

Keeps validation workflow read-only (contents: read) and notification
workflow separate (pull-requests: write via workflow_run, safe for forks).
Permissions at job level per least-permissive approach.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants