Repository navigation
Require release PR authors to have merge-capable repository access - #12
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 956d3afd-ae0b-486c-a60c-3a6276c23213
|
Copilot resolve the merge conflicts in this pull request |
…sions # Conflicts: # actions/release-pr/README.md # actions/release-pr/tests/test_release_pr.py Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Resolved the conflicts while preserving both changesets and merged |
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the release-action permission gate.
No open issues 🎉
What changed in this PR
This PR adds a live repository-permission check to the release action, requiring the PR creator to have write, maintain, or admin access before a release candidate proceeds in either mode.
Changes:
- Checks author permissions before stable-manifest preparation, rejecting insufficient access or lookup failures while preserving ordinary-PR skips.
- Adds tests for allowed roles, creator identity, rejection before writes, and authorization skips.
- Documents token requirements and adds a real permission-API smoke check using
github.token.
| File | Description |
|---|---|
actions/release-pr/tests/test_release_pr.py |
Adds mocked permission checks and coverage for authorization behavior in both modes. |
actions/release-pr/README.md |
Documents author eligibility, live checks, CLI availability, and token requirements. |
actions/release-pr/action.yml |
Adds the fail-closed PR-creator permission gate after candidate validation. |
.github/workflows/smoke-release-pr-action.yml |
Verifies permission lookup with the default action token. |
Review effort: Balanced
|
Reviewed commit: Result: Verification detailsVerification: Automated verification is best effort. The PR author remains responsible for testing. Summary: All 22 targeted tests passed in the Linux container: 15 release-action tests and 7 version-action tests. Coverage includes allowed/rejected permissions, fail-closed API errors before writes in both modes, and ordinary-PR authorization skips. Additional checks passed for identity/token wiring, step ordering, and Bash syntax. No failures occurred, but the live GitHub permission lookup and Windows/macOS runs remain unverified. **Reviewer dependency follow-up (nonblocking):** Suggest a separate PR adding `GitHub CLI (gh; no version constraint declared)` to the official reviewer dependency declarations, using `actions/release-pr/README.md` as the dependency/version evidence. Do not automatically create that PR. This is reviewer environment maintenance, not a required change to the reviewed PR. Test runs: 4 passed, 2 not run
|
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
## Summary Adds a dedicated **Release PR / Plan** check to all PRs targeting `main`, including edited/reopened PRs. Uses `contents: read`, no path filters, and the shared `release-pr` action pinned to reviewed commit `4e0c4335bbf6b1a274673e22d9c39cd7efb93ccf` in `mode: plan`. Only PRs changing root `package.json` alone, with a different version, are release candidates. Those must be version-only JSON changes with an increasing SemVer, a positive odd development minor, supported Marketplace bounds, and lossless serialization. Mixed-file changes and unchanged versions pass as **not applicable**, explicitly distinguished from validated candidates in the job summary. Other manifests, including `api/package.json`, are outside this check's scope. Existing CI and Azure publishing are unchanged. This does **not** create release branches, enable release mode, or change branch protection. Make the check required only after merging and observing it working; publishing activation remains a separate rollout. ## Validation - Prettier, whitespace, YAML contract, Bash syntax, and both summary outcomes pass. - Real external-consumer pilot: microsoft/vscode-black-formatter#839 (disposable; never merged). - [Valid version-only bump](https://github.com/microsoft/vscode-black-formatter/actions/runs/42701669435): passed with exact candidate output, nested stable-version action resolution, and an unchanged worktree. - [Invalid even-minor bump](https://github.com/microsoft/vscode-black-formatter/actions/runs/42701753358): failed as expected with "The development minor must be positive and odd". - [Mixed-file bump](https://github.com/microsoft/vscode-black-formatter/actions/runs/42701874256) and [unchanged-version manifest edit](https://github.com/microsoft/vscode-black-formatter/actions/runs/42702002023): passed with empty candidate output and an unchanged worktree. This adoption PR changes only the workflow. Its [Release PR / Plan check](https://github.com/microsoft/vscode-python-environments/actions/runs/42724187188) passed on head `7649eedcc247217d9835af154e5e3e106c081d3f` as **not applicable**. This workflow-only diff does not exercise candidate authorization; shared-action tests and hosted API smoke cover that behavior. ## Latest shared action Updated to merged commit `4e0c4335bbf6b1a274673e22d9c39cd7efb93ccf`, including microsoft/vscode-python-ci#11 and microsoft/vscode-python-ci#12. Release candidates now require the PR creator to have write/maintain/admin repository access; permission lookups fail closed. Configurable branch prefixes and the branch output are available, with the existing `release/` default. This workflow remains read-only plan mode. The linked disposable pilot covers the original baseline; shared-action CI covers the added prefix/authorization behavior. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 956d3afd-ae0b-486c-a60c-3a6276c23213
## Summary Adds a dedicated **Release PR / Plan** check to all PRs targeting `main`, including edited/reopened PRs. Uses `contents: read`, no path filters, and the shared `release-pr` action pinned to reviewed commit `4e0c4335bbf6b1a274673e22d9c39cd7efb93ccf` in `mode: plan`. Only PRs changing root `package.json` alone, with a different version, are release candidates. Those must be version-only JSON changes with an increasing SemVer, a positive odd development minor, supported Marketplace bounds, and lossless serialization. Mixed-file changes and unchanged versions pass as **not applicable**, explicitly distinguished from validated candidates in the job summary. Other manifests, including `api/package.json`, are outside this check's scope. Existing CI and Azure publishing are unchanged. This does **not** create release branches, enable release mode, or change branch protection. Make the check required only after merging and observing it working; publishing activation remains a separate rollout. ## Validation - Prettier, whitespace, YAML contract, Bash syntax, and both summary outcomes pass. - Real external-consumer pilot: microsoft/vscode-black-formatter#839 (disposable; never merged). - [Valid version-only bump](https://github.com/microsoft/vscode-black-formatter/actions/runs/42701669435): passed with exact candidate output, nested stable-version action resolution, and an unchanged worktree. - [Invalid even-minor bump](https://github.com/microsoft/vscode-black-formatter/actions/runs/42701753358): failed as expected with "The development minor must be positive and odd". - [Mixed-file bump](https://github.com/microsoft/vscode-black-formatter/actions/runs/42701874256) and [unchanged-version manifest edit](https://github.com/microsoft/vscode-black-formatter/actions/runs/42702002023): passed with empty candidate output and an unchanged worktree. This adoption PR changes only the workflow. Its [Release PR / Plan check](https://github.com/microsoft/vscode-python/actions/runs/42724186665) passed on head `fa1d9b2bcd5bbdba5caabab74832e0b385a94ed9` as **not applicable**. This workflow-only diff does not exercise candidate authorization; shared-action tests and hosted API smoke cover that behavior. Issue tracking: this is workflow-only maintenance from the shared CI rollout, with no separate product issue. Uses the repository's existing `skip-issue-check` label for that case. ## Latest shared action Updated to merged commit `4e0c4335bbf6b1a274673e22d9c39cd7efb93ccf`, including microsoft/vscode-python-ci#11 and microsoft/vscode-python-ci#12. Release candidates now require the PR creator to have write/maintain/admin repository access; permission lookups fail closed. Configurable branch prefixes and the branch output are available, with the existing `release/` default. This workflow remains read-only plan mode. The linked disposable pilot covers the original baseline; shared-action CI covers the added prefix/authorization behavior. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 956d3afd-ae0b-486c-a60c-3a6276c23213
Summary
Require the PR creator's GitHub account to have repository write, maintain, or admin permission before a version-only PR is accepted as a release candidate. This is the repository's merge-capable role threshold, not a bypass of protected-branch reviews or other merge requirements.
All existing manifest, version, file-mode and create-only push checks remain. No extension changes or publishing activation. Based on main, separately from prefix PR #11.
Validation