chore: skip CI for PRs opened by non-collaborators#100
Open
Rishavraaj wants to merge 4 commits into
Open
Conversation
Add an if condition to the ci job so it only runs on pushes to main or PRs from owners, members, or collaborators. External contributor PRs will show the job as skipped rather than consuming CI minutes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Temporary debug step to diagnose why CI is being skipped for org members. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add CONTRIBUTOR to the author_association allowlist so org members with private membership can trigger CI. Remove temporary debug job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONTRIBUTOR is assigned to anyone who has ever had a commit merged, including one-time external contributors. Only OWNER, MEMBER, and COLLABORATOR represent explicitly trusted collaborators. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
ifcondition to thecijob in.github/workflows/ci.ymlto skip CIfor PRs opened by non-collaborators
OWNER,MEMBER,COLLABORATOR, andCONTRIBUTORauthorassociations
FIRST_TIME_CONTRIBUTOR,FIRST_TIMER,NONE)will have CI skipped
mainalways run CI regardlessMotivation
Without this guard, every PR from an unknown contributor triggers the full CI
pipeline — consuming runner minutes and potentially executing untrusted code in the
CI environment.
How it works
GitHub Actions exposes
github.event.pull_request.author_associationonpull_requestevents:OWNERMEMBERCOLLABORATORCONTRIBUTORFIRST_TIME_CONTRIBUTORFIRST_TIMERNONETest plan
main→ CI always runs