Drop unnecessary secrets: inherit and lock codegen merge to App actor - #73
Merged
Conversation
Two additional Copilot findings on PR #71 that PR #72 was supposed to carry along with the behaviour->behavior spelling fix; auto-merge on PR #72 fired before this second commit landed, so re-applying here as a separate PR (PR #72 was already squashed). 1. build-pypilibrary-task.yml: the `get-version` job called `get-version-task.yml` with `secrets: inherit`, but that task workflow does not declare any required secrets. Drop the inherit so the job runs without secrets in scope — smaller blast radius. (build-nugetlibrary-task.yml has the same pattern; unmodified here per AGENTS.md opportunistic-pin scope rule.) 2. merge-bot-pull-request.yml `merge-codegen`: the `if:` gate checked PR author/branch/base but not the event actor. A maintainer pushing extra commits to the App's `codegen` branch would fire a `synchronize` event that this job would happily auto-merge — folding human changes into a release via the App PR. Restore the `github.actor == 'ptr727-codegen[bot]'` check (which the pre-consolidation `merge-codegen-app` job carried) alongside the existing PR author check. Comment expanded to explain why both checks matter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces GitHub Actions secret exposure and tightens the merge-bot’s auto-merge guardrails for codegen PRs to prevent unintended human-triggered updates from being merged via the App’s PR.
Changes:
- Removed
secrets: inheritfrom the PyPI build workflow’sget-versionreusable-workflow call (no required secrets). - Hardened
merge-codegenauto-merge gating by requiring both PR author and triggering actor to beptr727-codegen[bot], with expanded rationale in comments.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/merge-bot-pull-request.yml | Tightens merge-codegen if: condition to require bot actor as well as bot PR author. |
| .github/workflows/build-pypilibrary-task.yml | Drops unnecessary secrets: inherit on the get-version job to reduce secret blast radius. |
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
Two additional Copilot findings on PR #71 (develop → main release) that PR #72 was supposed to carry alongside the
behaviour → behaviorfix. Auto-merge on PR #72 fired before the second commit on its branch landed, so PR #72's squash captured only the spelling fix — these two land here separately.1.
secrets: inheritremoved fromget-versionjob inbuild-pypilibrary-task.ymlThe job calls
get-version-task.ymlwhich declares no required secrets.secrets: inheritwas widening the secret blast radius for no benefit. (Same pattern exists inbuild-nugetlibrary-task.yml, untouched here per AGENTS.md "Workflow YAML Conventions" — "existing workflows are migrated opportunistically when they're being touched for other reasons". Easy follow-up PR later.)2.
merge-codegenif:gate now requires App-actor tooThe current gate checks PR author/branch/base but not the event actor. A maintainer pushing extra commits to the App's
codegenbranch fires asynchronizeevent the job would happily auto-merge — folding human changes into a release through the App PR. Restoredgithub.actor == 'ptr727-codegen[bot]'(which the pre-consolidationmerge-codegen-appjob carried in PR #70-era code) alongside the existing PR author check. Comment expanded to explain why both checks matter.Test plan