Repository navigation
CI: Pass only ADD_TO_PROJECT_PAT to the add-to-project workflow - #1649
Conversation
project.yml runs on pull_request_target and passed secrets: inherit, so the shared add-to-project workflow in rossoctl/.github received every secret of this repo. That workflow reads only ADD_TO_PROJECT_PAT. Pass that one secret by name. The @main pin stays, so the shared workflow still updates automatically. Needs rossoctl/.github#137, which declares the secret. Without it the workflow fails with "ADD_TO_PROJECT_PAT is not defined in the referenced workflow". Part of rossoctl#1641 Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
clawgenti
left a comment
There was a problem hiding this comment.
Summary
This replaces secrets: inherit with a single named secret, ADD_TO_PROJECT_PAT, in the pull_request_target caller of the shared add-to-project workflow. The shared workflow (rossoctl/.github add-to-project.yml@main) reads only secrets.ADD_TO_PROJECT_PAT, so behavior stays the same and the called workflow no longer receives the rest of this repo's secrets. project.yml was the only secrets: inherit left in this repo's workflows. No blocking issues.
The one thing to watch is merge order. rossoctl/.github#137, which declares the secret under workflow_call.secrets, is approved but not merged yet. If this PR merges first, every issue/PR-opened run fails at workflow load time with Invalid secret ... not defined in the referenced workflow. The step-level continue-on-error in the called workflow does not cover that failure. Please merge #137 first, as the description says.
Author: huang195 (MEMBER — maintainer)
Areas reviewed: CI/GitHub Actions, YAML, Security
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (a few unrelated Go/pre-commit jobs still pending; the pull_request_target run uses the workflow from main, so it does not test this change)
| secrets: inherit | ||
| # Only the token the called workflow reads, not every secret of this repo. | ||
| secrets: | ||
| ADD_TO_PROJECT_PAT: ${{ secrets.ADD_TO_PROJECT_PAT }} |
There was a problem hiding this comment.
suggestion: This depends on rossoctl/.github#137, which is still open. Until that PR declares ADD_TO_PROJECT_PAT in on.workflow_call.secrets, GitHub rejects this caller at load time, and the step's continue-on-error does not apply. Please merge #137 first. After both merge, open a test issue to confirm the "Add item to Rossoctl Project" run still adds it to the project.
Problem
Part of #1641.
project.ymlruns onpull_request_targetand passessecrets: inherit. So the sharedadd-to-project.ymlin rossoctl/.github receives every secret of this repo, but it reads onlyADD_TO_PROJECT_PAT.The same admins control both repos, so this is hygiene, not an escalation: a person who can change rossoctl/.github can already push a workflow here. But there is no reason to pass secrets that the workflow does not use. OpenSSF Scorecard, which this repo runs, also flags this pattern.
Change
Pass only
ADD_TO_PROJECT_PAT, by name. The@mainpin stays, so the shared workflow still updates automatically.Merge order
Merge rossoctl/.github#137 first. It declares
ADD_TO_PROJECT_PATin the shared workflow. Without that declaration, this workflow fails withInvalid secret, ADD_TO_PROJECT_PAT is not defined in the referenced workflow.Verification
pull_request_targetuses the workflow frommain. The first real check is the first issue or PR after the merge. Its "Add item to Rossoctl Project" run must pass.Assisted-By: Claude (Anthropic AI) noreply@anthropic.com