Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/sync-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: sync next from main

on:
push:
branches: [main]
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: next
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Try fast-forward
id: ff
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git merge --ff-only origin/main; then
echo "result=ff" >> "$GITHUB_OUTPUT"
git push origin next
else
echo "result=diverged" >> "$GITHUB_OUTPUT"
fi
- name: Open sync PR if diverged
if: steps.ff.outputs.result == 'diverged'
uses: peter-evans/create-pull-request@v6
with:
branch: chore/sync-next-from-main
base: next
title: "chore: sync next from main"
body: |
Automated PR — `next` could not fast-forward from `main`.
Resolve any conflicts, then merge to bring `next` current.
delete-branch: true
Loading