Post conformance PR comment via workflow_run#86
Merged
Conversation
Fork PRs receive a read-only GITHUB_TOKEN regardless of the top-level permissions block, so the inline `gh pr comment` step in the conformance workflow fails with "Resource not accessible by integration" whenever a contributor opens a PR from a fork. Move the comment step into a separate workflow triggered by workflow_run, which runs in the base repo context with pull-requests: write and only reads the uploaded summary artifact — never checks out PR code.
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
GITHUB_TOKENregardless of the top-levelpermissionsblock, so the inlinegh pr commentstep inconformance.ymlfails withResource not accessible by integration (addComment)whenever a contributor opens a PR from a fork (e.g. Removed xeus-cling from tested kernels (not maintained anymore) #84).comment-on-pr.ymlworkflow triggered byworkflow_run, which runs in the base-repo context withpull-requests: writeand only reads the uploaded summary artifact — it never checks out PR code.conformance.ymlnow writespr_number.txtand uploadssummary.md+ the PR number as apr-commentartifact when the event is a PR.Caveat
workflow_runonly reads workflow files from the default branch, so the comment workflow won't fire for this PR itself — it'll start working on PRs opened after this lands onmain.Test plan
mainComment PR with Conformance ResultsworkflowKernel Conformanceworkflow still posts the step summary and uploads theconformance-reportsartifact