mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-04-22 03:07:55 +00:00
ci: add sync-branches workflow to keep main and master in sync
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
name: Sync main and master branches
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.PAT_TOKEN }}
|
||||||
|
|
||||||
|
- name: Sync branches
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||||
|
echo "main was updated, syncing master..."
|
||||||
|
git checkout master
|
||||||
|
git reset --hard origin/main
|
||||||
|
git push origin master --force
|
||||||
|
elif [ "${{ github.ref }}" = "refs/heads/master" ]; then
|
||||||
|
echo "master was updated, syncing main..."
|
||||||
|
git checkout main
|
||||||
|
git reset --hard origin/master
|
||||||
|
git push origin main --force
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user