forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 124
58 lines (51 loc) · 2.06 KB
/
merge_upstream_master.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
53
54
55
56
57
58
name: Merge Upstream Master
on:
issue_comment:
types: [created]
jobs:
merge-upstream:
if: |
github.event.issue.pull_request &&
(github.event.comment.body == '!merge_upstream') &&
((github.event.sender.id == github.event.issue.user.id) ||
(github.event.comment.author_association == 'COLLABORATOR') ||
(github.event.comment.author_association == 'MEMBER') ||
(github.event.comment.author_association == 'OWNER'))
runs-on: ubuntu-latest
steps:
- name: PR Data
run: |
curl -H "Authorization: token ${{ github.token }}" ${{ github.event.issue.pull_request.url }} > pr.json
echo "PR_REPO=`jq -r '.head.repo.full_name' < pr.json`" >> $GITHUB_ENV
echo "PR_BRANCH=`jq -r '.head.ref' < pr.json`" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ${{ env.PR_REPO }}
ref: ${{ env.PR_BRANCH }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: ./tgui/yarn.lock
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Perform Merge
run: |
chmod +x tools/bootstrap/python
bash tools/hooks/install.sh
bash tgui/bin/tgui --install-git-hooks
chmod +x tools/hooks/*.merge tgui/bin/tgui
git config user.name github-actions
git config user.email [email protected]
git remote add upstream "https://github.com/${{ github.repository }}.git"
git fetch upstream master
git merge upstream/master && git push origin
- name: Notify Failure
if: failure()
run: |
curl -s -H "Authorization: token ${{ github.token }}" \
-X POST -d '{"body": "Merging upstream failed:\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments"