Skip to content

Fix release-notes-comments: add actions: read, move if-guard and concurrency to consumer - #325

Merged
Mpdreamz merged 2 commits into
mainfrom
fix/changelog-comment-actions-read
Sep 1, 2026
Merged

Mpdreamz merged 2 commits into
mainfrom
fix/changelog-comment-actions-read

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Three bugs discovered while testing Changelog PR comments end-to-end against the playground repos.

Affects: Automation

Why

release-notes-comments.yml startup failure — permissions: {} at the workflow level in the reusable workflow overrides the caller's permission grants, zeroing the token. The if: condition and concurrency group both used github.event.workflow_run.*, which is not available inside a workflow_call context — only in the caller's workflow where the workflow_run event actually fires. Both caused startup_failure or silent skipped results.

actions: read missing — Check for decision artifact calls gh api .../artifacts and actions/download-artifact@v8 uses the GitHub artifacts API for cross-run downloads. Neither works without actions: read. The job's permissions: block lacked it.

Artifact never uploaded from release-notes path — The release-notes.yml validate job ran validate-labels with only --config and --pr-labels. The command needs --pr-number, --head-ref, --head-sha, and the fork flags to write complete decision metadata. And no upload step existed in the inline validate job — it had only been added to changelog/validate/action.yml (the evaluate-pr composite), not to the release-notes.yml reusable workflow.

What

release-notes-comments.yml — permissions, if:, and concurrency

permissions: {} removed from the workflow level so the caller's grants flow through. actions: read added to the job. The if: guard and concurrency block moved out — they belong in the caller's consumer workflow where github.event.workflow_run.* is accessible. The changelog/comment composite already handles missing artifacts gracefully, so the reusable workflow can run unconditionally.

release-notes.yml — PR context and artifact upload

The Validate labels step now passes --pr-number, --head-ref, --head-sha, --head-repo, and the three fork flags (--is-fork, --can-commit, --maintainer-can-modify) so the metadata file written by docs-builder changelog validate-labels is complete. An Upload decision artifact step (if: always()) is added after both gate steps, matching what changelog/validate/action.yml already had.

Consumer template (docs-builder repo PR and playground repos)

Consumers need permissions: { pull-requests: write, actions: read }, the if: guard, and the concurrency block directly on their workflow_run job — all three moved there from the reusable workflow.

Verify

Open a PR on docs-playground-release-notes-tagged with no changelog label. The release-notes / validate check should fail. Within ~30 seconds the Changelog PR comments workflow should post the sticky ### 📋 Changelog comment naming the missing label.

…onsumer

The if: condition and concurrency group used github.event.workflow_run.* which
is not accessible inside a workflow_call context — only in the caller's context.
Move both to the consumer workflow template. Add actions: read so the
download-artifact cross-run lookup can call the artifacts API.

Co-Authored-By: Claude <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner September 1, 2026 16:28
@Mpdreamz Mpdreamz added the bug Something isn't working label Sep 1, 2026
@Mpdreamz
Mpdreamz requested a review from theletterf September 1, 2026 16:28
@Mpdreamz Mpdreamz added the bug Something isn't working label Sep 1, 2026
validate-labels was only receiving --config and --pr-labels. The metadata
file it writes when IsRunningOnCI needs pr-number, head-ref, head-sha,
is-fork, can-commit, and maintainer-can-modify to be usable by the
downstream comment workflow. Also adds the upload step that was missing
from the inline validate job — it existed in changelog/validate/action.yml
but not in the reusable release-notes.yml workflow.

Co-Authored-By: Claude <[email protected]>
@Mpdreamz
Mpdreamz merged commit ec3db93 into main Sep 1, 2026
10 checks passed
@Mpdreamz
Mpdreamz deleted the fix/changelog-comment-actions-read branch September 1, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant