Skip to content

Commit 648e124

Browse files
committed
stuff
1 parent bb14ad7 commit 648e124

3 files changed

Lines changed: 59 additions & 124 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Backsync Release To Main
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
concurrency:
13+
group: backsync-release-to-main
14+
cancel-in-progress: false
15+
16+
env:
17+
HUSKY: "0"
18+
19+
jobs:
20+
backsync:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
steps:
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
25+
with:
26+
fetch-depth: 0
27+
- name: Fetch main
28+
run: git fetch origin main:refs/remotes/origin/main
29+
- name: Create or reuse backsync branch
30+
id: backsync_branch
31+
run: |
32+
release_sha="$(git rev-parse HEAD)"
33+
short_release_sha="$(git rev-parse --short=12 "$release_sha")"
34+
branch_name="backsync/${short_release_sha}"
35+
36+
git config user.name "github-actions[bot]"
37+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git switch --create "$branch_name" "$release_sha"
39+
git push origin "HEAD:refs/heads/$branch_name"
40+
41+
echo "branch_name=$branch_name" >> "$GITHUB_OUTPUT"
42+
echo "short_release_sha=$short_release_sha" >> "$GITHUB_OUTPUT"
43+
- name: Create backsync PR
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
gh pr create \
48+
--base main \
49+
--head "${{ steps.backsync_branch.outputs.branch_name }}" \
50+
--title "chore: Sync release branch to main (${{ steps.backsync_branch.outputs.short_release_sha }})" \
51+
--body "Synchronizes the main branch with the release branch. (changed files should generally only be package versions, changeset files, and changelogs)"

.github/workflows/prepare-js-release.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ jobs:
6464
git add -A
6565
git commit -m "chore: Prepare changelog"
6666
git push origin HEAD:refs/heads/${{ steps.source.outputs.release_branch }}
67-
- name: Create or update release PR
67+
- name: Create release PR
6868
env:
69-
GITHUB_TOKEN: ${{ github.token }}
70-
run: >
71-
node scripts/release/upsert-pull-request.mjs
72-
--base release
73-
--head "${{ steps.source.outputs.release_branch }}"
74-
--title "chore: Prepare for release (${{ steps.source.outputs.short_main_sha }})"
75-
--body "Prepares a release by updating changelogs and package versions, and synchronizing everything to the release branch."
69+
GH_TOKEN: ${{ github.token }}
70+
run: |
71+
gh pr create \
72+
--base release \
73+
--head "${{ steps.source.outputs.release_branch }}" \
74+
--title "chore: Prepare for release (${{ steps.source.outputs.short_main_sha }})" \
75+
--body "Prepares a release by updating changelogs and package versions, and synchronizing everything to the release branch."

scripts/release/upsert-pull-request.mjs

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)