1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/.github/workflows/branch-sync.yaml

42 lines
1.2 KiB
YAML

name: Sync Master to Release Branch
on:
push:
branches:
- master
jobs:
sync_master_to_release:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "github-actions-bot@users.noreply.github.com"
- name: Merge master into release
run: |
BRANCH_NAME="${{ vars.BRANCH_SYNC_TARGET }}"
if [ -z "$BRANCH_NAME" ]; then echo "BRANCH_SYNC_TARGET variable is not set" && exit 1; fi
echo "Syncing master to $BRANCH_NAME"
git checkout master
git pull origin master
MASTER_COMMIT=$(git rev-parse HEAD)
git fetch origin $BRANCH_NAME
git checkout $BRANCH_NAME
git pull origin $BRANCH_NAME
RELEASE_COMMIT=$(git rev-parse HEAD)
echo "Rebasing $BRANCH_NAME ($RELEASE_COMMIT) onto master ($MASTER_COMMIT)"
git rebase master
git push origin $BRANCH_NAME
echo "Merged master ($MASTER_COMMIT) into $BRANCH_NAME ($RELEASE_COMMIT)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}