-
Notifications
You must be signed in to change notification settings - Fork 22
52 lines (45 loc) · 1.76 KB
/
propagate-main-to-v7.1.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
41
42
43
44
45
46
47
48
49
50
51
52
# This action will copy changes from main into the v7.1 branch, and is done whenever the main branch is updated.
#
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
---
name: Propagate main to 7.1
on:
push:
branches: [main]
permissions:
contents: read
jobs:
merge-to-v71:
permissions:
contents: write # for Git to git push
pull-requests: write # for Git to create a pull request
runs-on: ubuntu-latest
steps:
- name: Check out GEDCOM
uses: actions/checkout@v4
- name: Set git config
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
git config -l
- name: Check for diffs
id: diff
run: |
git fetch origin
git diff --quiet origin/main..origin/v7.1 || echo "::set-output name=status::changes"
- name: Create Pull Request
if: steps.diff.outputs.status == 'changes'
run: |
git checkout -b merge-main-into-v7.1
git push -f --set-upstream origin merge-main-into-v7.1
if ! gh pr list | grep -q "merge-main-into-v7.1"; then
gh pr create -B v7.1 -H merge-main-into-v7.1 --title 'Merge main into v7.1' --body $'Copy changes from main to v7.1\nThis PR is auto-generated by [gh pr create].' --label 'automated pr' --repo ${{ github.repository }}
fi
env:
GH_TOKEN: ${{ github.token }}