-
Notifications
You must be signed in to change notification settings - Fork 58
32 lines (27 loc) · 943 Bytes
/
sync-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Automatically Sync PR with Base Branch
on:
pull_request:
types:
- opened
- synchronize
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Configure Git Identity
run: |
git config --global user.email "ci-build@aemforms"
git config --global user.name "ci-build"
- name: Sync with Base Branch
run: |
git fetch origin
git checkout ${{ github.event.pull_request.base.ref }}
git pull origin ${{ github.event.pull_request.base.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
git pull origin ${{ github.event.pull_request.head.ref }}
git rebase ${{ github.event.pull_request.base.ref }}
git push --force origin ${{ github.event.pull_request.head.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}