Skip to content

Address Copilot review on PR #71: spelling + secrets + actor gate - #72

Merged
ptr727 merged 1 commit into
developfrom
behaviour-to-behavior
May 11, 2026
Merged

Address Copilot review on PR #71: spelling + secrets + actor gate#72
ptr727 merged 1 commit into
developfrom
behaviour-to-behavior

Conversation

@ptr727

@ptr727ptr727 commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

Three small fixes for PR #71 (develop → main release) Copilot review:

  1. behaviourbehavior (.github/workflows/merge-bot-pull-request.yml — comment) — AGENTS.md US-English style rule.
  2. Drop secrets: inherit on the get-version job in build-pypilibrary-task.ymlget-version-task.yml doesn't declare any required secrets, so inheriting was a no-op that widened the secret blast radius unnecessarily.
  3. Lock merge-codegen to App-actor synchronize events — the if: gate previously 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 the job would happily auto-merge, folding human changes into a release through the App PR. Restored github.actor == 'ptr727-codegen[bot]' to the gate (it was carried by the pre-consolidation merge-codegen-app job; got dropped during the App-only consolidation in PR Standardize bots on GitHub App token, align merge methods, version PyPI via NBGV #70). Both checks are now in place with a comment explaining why each matters.

Out of scope

  • build-nugetlibrary-task.yml has the same secrets: inherit on its inner get-version call. This branch doesn't touch that file; per AGENTS.md "Workflow YAML Conventions" ("existing workflows are migrated opportunistically when they're being touched for other reasons"), leaving it alone here. Easy 1-line follow-up PR later.

Test plan

Tiny US-English typo fix in the new dependabot-merge step comment
landed in PR #70. AGENTS.md requires US English; flagged by Copilot
review on PR #71 (the develop -> main release).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings May 11, 2026 20:20

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a US-English spelling inconsistency in the merge-bot workflow comment (“behaviour” → “behavior”) to align with the repo’s documentation style conventions and avoid recurring review noise in future release/merge diffs.

Changes:

  • Update a single comment line in the merge-bot workflow to use US-English spelling.

@ptr727
ptr727 enabled auto-merge (squash) May 11, 2026 20:25
@ptr727
ptr727 merged commit 4ddc6b9 into developMay 11, 2026
25 checks passed
@ptr727ptr727 changed the title Spell behavior, not behaviour, in merge-bot commentAddress Copilot review on PR #71: spelling + secrets + actor gateMay 11, 2026
ptr727 added a commit that referenced this pull request May 11, 2026
…#73)
## Summary
Two additional Copilot findings on [PR
#71](#71) (develop → main
release) that PR #72 was supposed to carry alongside the `behaviour →
behavior` fix. 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: inherit` removed from `get-version` job in
`build-pypilibrary-task.yml`
The job calls
[`get-version-task.yml`](.github/workflows/get-version-task.yml) which
declares no required secrets. `secrets: inherit` was widening the secret
blast radius for no benefit. (Same pattern exists in
`build-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-codegen` `if:` gate now requires App-actor too
The current gate checks PR author/branch/base but not the event actor. A
maintainer pushing extra commits to the App's `codegen` branch fires a
`synchronize` event the job would happily auto-merge — folding human
changes into a release through the App PR. Restored `github.actor ==
'ptr727-codegen[bot]'` (which the pre-consolidation `merge-codegen-app`
job carried in PR #70-era code) alongside the existing PR author check.
Comment expanded to explain why both checks matter.
```diff
+ # Both the PR author AND the event actor must be the App: the author
+ # check stops human-opened PRs that happen to target the `codegen`
+ # branch from auto-merging; the actor check stops a maintainer
+ # pushing extra commits to the App's `codegen` branch (a
+ # `synchronize` event the human triggered) from auto-merging
+ # unintended changes through the App PR.
if: >-
github.event.pull_request.user.login == 'ptr727-codegen[bot]' &&
+ github.actor == 'ptr727-codegen[bot]' &&
github.event.pull_request.head.ref == 'codegen' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.repo.full_name == github.repository
```
## Test plan
- [ ] CI passes on this PR.
- [ ] After merge to develop, PR #71's two remaining Copilot threads
(lines 25 and 93) can be resolved.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@ptr727