-
-
Notifications
You must be signed in to change notification settings - Fork 255
52 lines (47 loc) · 1.95 KB
/
merge-pro.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
name: Merge community changes into pro repo
on:
push:
branches:
- master
jobs:
updateFork:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: tiny-pilot/tinypilot-pro
token: ${{ secrets.PR_BOT_PAT }}
- name: Reset the default branch with upstream changes
run: |
git remote add upstream https://github.com/tiny-pilot/tinypilot.git
git fetch upstream master:upstream-master
git reset --hard upstream-master
- name: Get the URL of the original community PR
run: |
set -ux
COMMUNITY_PR_URL="$(curl \
--silent \
--show-error \
https://api.github.com/repos/tiny-pilot/tinypilot/commits/${{ github.sha }}/pulls?per_page=1 | \
jq \
--raw-output \
'.[0].html_url | select (.!=null)')"
readonly COMMUNITY_PR_URL
echo "COMMUNITY_PR_URL=${COMMUNITY_PR_URL}" >> "${GITHUB_ENV}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PR_BOT_PAT }}
branch: community-changes-${{ github.sha }}
delete-branch: true
# If the committer to the community repo (github.actor) has no access
# to the pro repo, the PR will be unassigned.
assignees: ${{ github.actor }}
title: Merge changes from community repository
body: |
Related ${{ env.COMMUNITY_PR_URL }}
@${{ github.actor }}, please review these changes yourself and merge them from the community repository:
https://github.com/tiny-pilot/tinypilot/commit/${{ github.sha }}
**Do not use "Squash and merge"!**
Merge this PR with a merge commit, keeping the commit history.
(If you accidentally squash, it's not a disaster, but it will create a bit of noise on the subsequent PR from Community)