Skip to content

fix: post PR verification comment via workflow_run to support fork PRs#146

Merged
tiraboschi merged 1 commit intoopenshift-virtualization:mainfrom
tiraboschi:fix_pr_comment
Apr 15, 2026
Merged

fix: post PR verification comment via workflow_run to support fork PRs#146
tiraboschi merged 1 commit intoopenshift-virtualization:mainfrom
tiraboschi:fix_pr_comment

Conversation

@tiraboschi
Copy link
Copy Markdown
Collaborator

GitHub hard-limits GITHUB_TOKEN to read-only for pull_request events from forks, regardless of the permissions block in the workflow. This makes it impossible to post comments from within the verify job itself.

The fix splits the concern into two workflows:

  • verify-generated.yml: runs on pull_request (sandboxed, safe for forks), saves the PR number as an artifact, no write permissions needed.
  • comment-pr-verification.yml: runs on workflow_run in the base-repo context (write access), downloads the artifact, and posts the comment.

GitHub hard-limits GITHUB_TOKEN to read-only for pull_request events
from forks, regardless of the permissions block in the workflow. This
makes it impossible to post comments from within the verify job itself.

The fix splits the concern into two workflows:
- verify-generated.yml: runs on pull_request (sandboxed, safe for forks),
  saves the PR number as an artifact, no write permissions needed.
- comment-pr-verification.yml: runs on workflow_run in the base-repo
  context (write access), downloads the artifact, and posts the comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@tiraboschi tiraboschi merged commit bbd8b75 into openshift-virtualization:main Apr 15, 2026
5 checks passed
@tiraboschi tiraboschi deleted the fix_pr_comment branch April 15, 2026 15:36
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