-
-
Notifications
You must be signed in to change notification settings - Fork 19
40 lines (35 loc) · 1.06 KB
/
auto-merge.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
33
34
35
36
37
38
39
40
name: Auto merge main into fsrs-browser
# Run on push to fsrs-browser to make CI pass when there's a merge conflict and manual merging is required.
on:
push:
branches:
- 'fsrs-browser'
release:
types: [published]
jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Compute tag
id: compute-tag
run: |
set -e
TAG=$(cat Cargo.toml \
| grep --extended-regexp "^version =" \
| grep --extended-regexp --only-matching "[0-9]+\.[0-9]+.[0-9]+[-\.\+a-zA-Z0-9]*" \
| head --lines=1)
echo "tag=v$TAG" >> "$GITHUB_OUTPUT"
- name: Set Git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
- name: Merge main into fsrs-browser
env:
TAG: ${{ steps.compute-tag.outputs.tag }}
run: |
git fetch --unshallow
git checkout fsrs-browser
git pull
git merge origin/main -m "Auto-merge for $TAG"
git push