[NoQA] Prevent GH actions from running on auto-closed PRs#84884
[NoQA] Prevent GH actions from running on auto-closed PRs#84884MonilBhavsar merged 10 commits intomainfrom
Conversation
Extracts the authorization check logic (org membership, linked issue assignment, linked PR author/reviewer) into a reusable workflow_call workflow that outputs IS_AUTHORIZED. This allows expensive PR workflows to skip CI for unauthorized contributors without duplicating the logic. Made-with: Cursor
Replace inline validation logic with a call to the new contributorValidationGate reusable workflow. The close/lock/comment logic now runs in a separate job conditioned on IS_AUTHORIZED == false. Made-with: Cursor
Skip AI code review (Anthropic API calls) for unauthorized contributors by adding the reusable validation gate as a prerequisite job. Made-with: Cursor
Skip 8-shard Jest suite and Storybook tests for unauthorized contributors. Uses always() + skipped check to preserve the workflow_call path from preDeploy.yml. Made-with: Cursor
Skip double npm install + perf benchmarks for unauthorized contributors. Made-with: Cursor
Skip OpenAI API calls for unauthorized contributors. Preserves the workflow_dispatch path for manual triggers. Made-with: Cursor
Skip full native builds (32-vCPU Android + macOS iOS) for unauthorized contributors. The fork comment job is left ungated since it's lightweight. Made-with: Cursor
Skip CLA check for unauthorized contributors on pull_request_target. The issue_comment trigger (for 'recheck' / signing) still runs ungated. Made-with: Cursor
Skip PR description modification for unauthorized contributors. Preserves the 'checklist' job name required by PHP. Made-with: Cursor
…, hybridapp) These workflows use the pull_request event which is already gated by GitHub's fork approval setting. Only pull_request_target workflows (claude-review, CLA, authorChecklist) need explicit gating. Made-with: Cursor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bc591af57
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| jobs: | ||
| validate: | ||
| uses: ./.github/workflows/contributorValidationGate.yml |
There was a problem hiding this comment.
Grant issue-read scope before calling contributor gate
Calling contributorValidationGate.yml from this workflow can misclassify legitimate external contributors as unauthorized, because the gate uses github.rest.issues.get to validate linked assigned issues, but this workflow only grants contents and pull-requests permissions. With GitHub Actions permissions, omitted scopes are none, so issue lookups fail and PRs that should pass via linked-issue assignment will skip Claude review.
Useful? React with 👍 / 👎.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Applying Internal QA label to remind us to QA |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
I'll QA this within the next hour or two |
QA successful! |
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.3.36-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.36-10 🚀
|
Explanation of Change
New reusable workflow:
contributorValidationGate.ymlworkflow_callworkflow that outputsIS_AUTHORIZEDpull_request_targetworkflows to skip CI for unauthorized contributorsGated workflows:
claude-review.yml— skips Anthropic API calls for unauthorized PRscla.yml— skips CLA check (avoids noisy comments on spam PRs)authorChecklist.yml— skips PR description modification on spam PRsFixed Issues
Improvement for https://github.com/Expensify/Expensify/issues/609533
Tests
Offline tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.