Skip to content

fix(ci): split sync workflow auth between commit and release apps - #59

Merged
c-vigo merged 6 commits into
mainfrom
feature/52-post-release-dev-protection
Mar 12, 2026
Merged

c-vigo merged 6 commits into
mainfrom
feature/52-post-release-dev-protection

Conversation

@c-vigo

@c-vigo c-vigo commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR finalizes the branch-protection-safe sync flow by tightening auth boundaries and workflow behavior across both sync workflows.

It separates GitHub App responsibilities (commit/ref operations vs PR/label operations), updates issue-sync auth to the commit app, and ensures manual sync output directory input is respected.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • .github/workflows/sync-main-to-dev.yml
    • Split auth into COMMIT_APP_* (checkout/git refs) and RELEASE_APP_* (PR/labels)
    • Keep stale sync-branch git-ref cleanup on commit-scoped token
    • Generate release token only when re-check confirms sync work is still needed
    • Keep conflict-path behavior and duplicate-PR guard intact
  • .github/workflows/sync-issues.yml
    • Switch app auth secrets to COMMIT_APP_ID / COMMIT_APP_PRIVATE_KEY
    • Pass workflow_dispatch output-dir input through to the action with docs fallback
  • CHANGELOG.md

Changelog Entry

Changed

  • Post-release replaced by PR-based main-to-dev sync (#52)
    • Remove post-release.yml workflow; add sync-main-to-dev.yml that opens a PR to sync main into dev, satisfying branch protection on both branches
    • Harden sync checks by failing clearly when origin/main or origin/dev is missing instead of silently treating branches as up to date
    • Fix workflow_dispatch hyphenated input access and conflict path robustness (issues: write, safer conflict label handling, clearer manual resolution commands)
    • Reduce duplicate/no-op sync PR risk by re-checking ahead/behind state inside the sync job and tightening existing-sync-PR detection (search + explicit list limit)
    • Split auth into explicit app tokens by responsibility: COMMIT_APP_* for checkout/ref operations and RELEASE_APP_* for PR/label operations requiring broader scopes
    • Generate RELEASE_APP_* only after re-check confirms sync work remains, reducing unnecessary broader-scope token issuance
  • Sync workflow uses commit-scoped app secrets and manual output target
    • Update sync-issues.yml to use COMMIT_APP_ID/COMMIT_APP_PRIVATE_KEY for both checkout token generation and action app auth inputs
    • Respect workflow_dispatch output-dir input in the action call, with 'docs' as the default fallback

Testing

  • Tests pass locally (npm test) — 95/95 passed
  • CHANGELOG validation passed (prepare_changelog.py validate)
  • Manual testing performed (conflict path and duplicate-PR guard)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • New and existing unit tests pass locally with my changes

Additional Notes

Post-merge validation on main should still confirm no-op early exit and clean no-conflict PR creation paths.

Refs: #52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the sync-main-to-dev.yml GitHub Actions workflow by splitting authentication into two GitHub App tokens, separating least-privilege git/ref operations from broader PR/label operations.

Changes:

  • Introduces separate GitHub App tokens (COMMIT_APP_* and RELEASE_APP_*) in the sync workflow and routes steps to the appropriate token.
  • Updates workflow header documentation to describe the token split.
  • Updates the Unreleased changelog entry for #52 to record the auth-token separation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/sync-main-to-dev.yml Splits GitHub App auth into commit vs release tokens and re-wires checkout / gh CLI operations accordingly.
CHANGELOG.md Records the token-responsibility split in the Unreleased notes for #52.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/sync-main-to-dev.yml Resolved
Comment thread .github/workflows/sync-main-to-dev.yml Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/sync-main-to-dev.yml Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@c-vigo
c-vigo enabled auto-merge March 2, 2026 21:08
@c-vigo c-vigo linked an issue Mar 3, 2026 that may be closed by this pull request
- Replaced the previous secrets for the GitHub App ID and private key in the sync-issues workflow with new ones to enhance security and maintain functionality.
- Updated CHANGELOG
@c-vigo

c-vigo commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

@gerchowl reminder

@c-vigo
c-vigo merged commit 5a3a206 into main Mar 12, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/52-post-release-dev-protection branch March 12, 2026 14:07
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.

[BUG] Post-Release sync push to dev rejected by branch protection

3 participants