Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit 94afd39

Browse files
committed
feat: add promote to stable workflow and sync stable back to main
This commit introduces a new GitHub Actions workflow for promoting changes from the main branch to the stable branch, along with a step to sync the stable branch back to main after a release. The workflow includes token generation and proper Git configuration for automated commits.
1 parent 923a365 commit 94afd39

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Promote to Stable
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
promote:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Generate token
11+
id: generate_token
12+
uses: actions/create-github-app-token@v2
13+
with:
14+
app-id: ${{ secrets.APP_ID }}
15+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
16+
17+
- uses: actions/checkout@v5
18+
with:
19+
fetch-depth: 0
20+
token: ${{ steps.generate_token.outputs.token }}
21+
22+
- run: |
23+
git config user.name "github-actions[bot]"
24+
git config user.email "github-actions[bot]@users.noreply.github.com"
25+
git checkout stable || git checkout -b stable
26+
git merge main --no-ff -m "chore: promote main to stable"
27+
git push origin stable

.github/workflows/release-package.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,15 @@ jobs:
5151
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5252
run: |
5353
pnpm dlx semantic-release
54+
55+
- name: Sync stable back to main
56+
if: github.ref == 'refs/heads/stable'
57+
env:
58+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
59+
run: |
60+
git config user.name "github-actions[bot]"
61+
git config user.email "github-actions[bot]@users.noreply.github.com"
62+
git fetch origin main stable
63+
git checkout main
64+
git merge origin/stable -m "chore: sync stable release to main"
65+
git push origin main

0 commit comments

Comments
 (0)