Repository navigation
Fix release-notes-comments: add actions: read, move if-guard and concurrency to consumer - #325
Merged
Merged
Conversation
…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]>
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]>
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.
Three bugs discovered while testing
Changelog PR commentsend-to-end against the playground repos.Affects: Automation
Why
release-notes-comments.ymlstartup failure —permissions: {}at the workflow level in the reusable workflow overrides the caller's permission grants, zeroing the token. Theif:condition andconcurrencygroup both usedgithub.event.workflow_run.*, which is not available inside aworkflow_callcontext — only in the caller's workflow where theworkflow_runevent actually fires. Both causedstartup_failureor silentskippedresults.actions: readmissing —Check for decision artifactcallsgh api .../artifactsandactions/download-artifact@v8uses the GitHub artifacts API for cross-run downloads. Neither works withoutactions: read. The job'spermissions:block lacked it.Artifact never uploaded from
release-notespath — Therelease-notes.ymlvalidate job ranvalidate-labelswith only--configand--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 tochangelog/validate/action.yml(theevaluate-prcomposite), not to therelease-notes.ymlreusable workflow.What
release-notes-comments.yml— permissions,if:, and concurrencypermissions: {}removed from the workflow level so the caller's grants flow through.actions: readadded to the job. Theif:guard andconcurrencyblock moved out — they belong in the caller's consumer workflow wheregithub.event.workflow_run.*is accessible. Thechangelog/commentcomposite already handles missing artifacts gracefully, so the reusable workflow can run unconditionally.release-notes.yml— PR context and artifact uploadThe
Validate labelsstep 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 bydocs-builder changelog validate-labelsis complete. AnUpload decision artifactstep (if: always()) is added after both gate steps, matching whatchangelog/validate/action.ymlalready had.Consumer template (docs-builder repo PR and playground repos)
Consumers need
permissions: { pull-requests: write, actions: read }, theif:guard, and theconcurrencyblock directly on theirworkflow_runjob — all three moved there from the reusable workflow.Verify
Open a PR on
docs-playground-release-notes-taggedwith no changelog label. Therelease-notes / validatecheck should fail. Within ~30 seconds theChangelog PR commentsworkflow should post the sticky### 📋 Changelogcomment naming the missing label.