Skip to content

fix(release): open validated promotions as bot PRs - #2250

Merged
tamirdresher merged 2 commits into
github:devfrom
tamirdresher:chore/promotion-pr-bot
Oct 19, 2026
Merged

tamirdresher merged 2 commits into
github:devfrom
tamirdresher:chore/promotion-pr-bot

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

Summary

Add a human-triggered promotion_branch mode to squad-promote.yml. It revalidates an existing sanitized upstream branch and opens the protected main promotion PR using github-actions[bot], so a different write collaborator can supply the required approval.

Why

  • tamirdresher_microsoft is an Enterprise Managed User and GitHub rejects external pull-request creation with HTTP 403.
  • A PR authored by tamirdresher cannot be approved by the same account.
  • GitHub documents that a PR created with GITHUB_TOKEN generates pull_request workflow runs in an approval-required state; a write maintainer can approve those runs, then review and merge the bot-authored PR.
  • The Actions-permissions API is admin-gated for the current token, so the workflow will surface clearly if the repository-level “Allow GitHub Actions to create and approve pull requests” setting is disabled.

Safety

The new path validates branch naming, ancestry from current main, stripped internal paths, consumed changesets, package/lock versions, SDK dependency floors, changelog presence, build/test success, and a clean post-validation tree before opening a PR. The existing legacy path is unchanged.

Validation

  • SKIP_BUILD_BUMP=1 npm run build
  • npx vitest run test/standalone-release-workflow.test.ts --reporter=dot — 34 passed
  • YAML parse and git diff --check
  • Strict repo-sync audit passed

Add a human-triggered promotion mode that revalidates an existing sanitized branch and opens the protected-main PR with github-actions[bot], allowing an independent maintainer approval.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58833b4b-f8e7-42b8-bf04-9121f362f68c
Copilot AI balanced review requested due to automatic review settings October 19, 2026 08:47
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #2250

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 8
Files added 1
Files modified 7
Files deleted 0
Modules touched 7

🎯 Risk Factors

  • 8 files changed (6-20 → MEDIUM)
  • 7 modules touched (5-8 → HIGH)

📦 Modules Affected

ci-workflows (1 file)
  • .github/workflows/squad-promote.yml
copilot-config (1 file)
  • .copilot/skills/release-process/SKILL.md
root (2 files)
  • .changeset/promotion-bot-pr.md
  • templates/skills/release-process/SKILL.md
squad-cli (1 file)
  • packages/squad-cli/templates/skills/release-process/SKILL.md
squad-sdk (1 file)
  • packages/squad-sdk/templates/skills/release-process/SKILL.md
templates (1 file)
  • .squad-templates/skills/release-process/SKILL.md
tests (1 file)
  • test/standalone-release-workflow.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

Copy link
Copy Markdown
Contributor

🔒 Security Review

Authoritative evidence: base-controlled pull_request_target reporter.

🔒 Security review: 1 info.

Severity Category Finding Location
ℹ️ info workflow-permissions Workflow grants write permission — verify this is the minimum required scope. .github/workflows/squad-promote.yml:33

Automated security review — informational only.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit d3173f2

PR Scope: 🔧 Infrastructure

⚠️ 4 item(s) to address before review

Status Check Details
❌ Single commit 2 commits — consider squashing before review
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present Changeset file found
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
❌ Copilot threads resolved 2 unresolved Copilot thread(s) — fix and resolve before merging
❌ CI passing 9 check(s) still running

Files Changed (8 files, +293 −11)

File +/−
.changeset/promotion-bot-pr.md +6 −0
.copilot/skills/release-process/SKILL.md +23 −6
.github/workflows/squad-promote.yml +154 −0
.squad-templates/skills/release-process/SKILL.md +19 −1
packages/squad-cli/templates/skills/release-process/SKILL.md +19 −1
packages/squad-sdk/templates/skills/release-process/SKILL.md +19 −1
templates/skills/release-process/SKILL.md +19 −1
test/standalone-release-workflow.test.ts +34 −1

Total: +293 −11


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copilot AI 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.

🟡 Changes recommended

Promotion validation gaps, sanitized-checkout CI incompatibility, and missing changelog coverage remain unresolved.

4 open issues
What changed in this PR

Adds a manually triggered mode that revalidates an existing sanitized promotion branch and opens a bot-authored PR to protected main.

Changes:

  • Adds branch, release-tree, build, and test validation before PR creation.
  • Preserves the legacy promotion path when no branch is supplied.
  • Adds workflow assertions and updates release instructions.
File Description
test/​standalone-release-workflow.test.ts Adds assertions for bot-authored promotions.
templates/​skills/​release-process/​SKILL.md Documents the new promotion option.
packages/​squad-sdk/​templates/​skills/​release-process/​SKILL.md Updates SDK-bundled release guidance.
packages/​squad-cli/​templates/​skills/​release-process/​SKILL.md Updates CLI-bundled release guidance.
.squad-templates/​skills/​release-process/​SKILL.md Updates canonical release guidance.
.github/​workflows/​squad-promote.yml Adds existing-branch validation and PR creation.
.copilot/​skills/​release-process/​SKILL.md Documents maintainer approval and merge steps.

Review effort: Balanced

run: npm run build

- name: Run release tests
run: node --test test/*.test.cjs
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
if [[ ! "${BRANCH}" =~ ^chore/promote(-v)?-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
lock_root="$(node -p 'require("./package-lock.json").version')"
lock_sdk="$(node -p 'require("./package-lock.json").packages["packages/squad-sdk"].version')"
lock_cli="$(node -p 'require("./package-lock.json").packages["packages/squad-cli"].version')"
if [ "${lock_root}" != "${version}" ] || [ "${lock_sdk}" != "${version}" ] || [ "${lock_cli}" != "${version}" ]; then
Comment on lines +175 to +177
When a validated sanitized promotion branch already exists in the upstream
repository, a human can instead have `github-actions[bot]` open the protected
`main` PR:
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58833b4b-f8e7-42b8-bf04-9121f362f68c
@tamirdresher
tamirdresher merged commit 610139b into github:dev Oct 19, 2026
19 checks passed
tamirdresher added a commit to tamirdresher/squad that referenced this pull request Oct 19, 2026
Carry the protected-main promotion PR path from github#2250 into the v1.0.2 release tree while keeping consumed changesets out of the stable branch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58833b4b-f8e7-42b8-bf04-9121f362f68c
Sign up for free to 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