-
Notifications
You must be signed in to change notification settings - Fork 20
36 lines (35 loc) · 1.08 KB
/
Copy pathrebase_dependencies.yml
File metadata and controls
36 lines (35 loc) · 1.08 KB
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
33
34
35
36
name: Automatic Rebase
on:
push:
branches:
- master
jobs:
check-branch:
name: Check if dependencies branch exists
runs-on: ubuntu-latest
outputs:
branch_exists: ${{ steps.check.outputs.exists }}
steps:
- name: Check for dependencies branch
id: check
run: |
if git ls-remote --exit-code --heads https://github.com/${{ github.repository }}.git dependencies > /dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
rebase:
name: Rebase `dependencies` with `master`
needs: check-branch
if: needs.check-branch.outputs.branch_exists == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
ref: dependencies
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git rebase origin/master
git push origin dependencies --force