-
Notifications
You must be signed in to change notification settings - Fork 2.1k
79 lines (78 loc) · 3.03 KB
/
Copy pathauto-merge-sync.yml
File metadata and controls
79 lines (78 loc) · 3.03 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Auto-merge sync PRs
on:
pull_request:
types: [opened, reopened, ready_for_review, labeled, synchronize]
permissions:
contents: write
pull-requests: write
checks: read
jobs:
auto-merge:
if: >
contains(join(github.event.pull_request.labels.*.name, ','), 'sync') && contains('suchintan,wintonzheng,LawyZheng,pedrohsdb,marcmuon,celalzamanoglu,AronPerez,andrewneilson,cindehaa,trevor-cheung,cursoragent,claude[bot],copilot-swe-agent[bot]', github.event.pull_request.user.login)
runs-on: ubuntu-latest
steps:
- name: Wait for all required checks to pass
uses: lewagon/wait-on-check-action@3603e826ee561ea102b58accb5ea55a1a7482343 # v1.4.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
ignore-checks: auto-merge, Mintlify Deployment
allowed-conclusions: success, skipped, neutral
- name: Set token for author
id: set-token
run: |
case "${{ github.event.pull_request.user.login }}" in
wintonzheng)
echo "GH_PAT=${{ secrets.SKYVERN_CLOUD_GH_PAT }}" >> $GITHUB_OUTPUT
;;
LawyZheng)
echo "GH_PAT=${{ secrets.LAWY_GH_PAT }}" >> $GITHUB_OUTPUT
;;
suchintan)
echo "GH_PAT=${{ secrets.SUCHINTAN_GH_PAT }}" >> $GITHUB_OUTPUT
;;
pedrohsdb)
echo "GH_PAT=${{ secrets.PEDROHSDB_GH_PAT }}" >> $GITHUB_OUTPUT
;;
marcmuon)
echo "GH_PAT=${{ secrets.MARC_GH_PAT }}" >> $GITHUB_OUTPUT
;;
celalzamanoglu)
echo "GH_PAT=${{ secrets.CELAL_GH_PAT }}" >> $GITHUB_OUTPUT
;;
andrewneilson)
echo "GH_PAT=${{ secrets.ANDREW_GH_PAT }}" >> $GITHUB_OUTPUT
;;
cindehaa)
echo "GH_PAT=${{ secrets.CINDY_GH_PAT }}" >> $GITHUB_OUTPUT
;;
trevor-cheung)
echo "GH_PAT=${{ secrets.TREVOR_GH_PAT }}" >> $GITHUB_OUTPUT
;;
AronPerez)
echo "GH_PAT=${{ secrets.AARON_GH_PAT }}" >> $GITHUB_OUTPUT
;;
cursoragent)
echo "GH_PAT=${{ secrets.SKYVERN_CLOUD_GH_PAT }}" >> $GITHUB_OUTPUT
;;
claude\[bot\])
echo "GH_PAT=${{ secrets.SKYVERN_CLOUD_GH_PAT }}" >> $GITHUB_OUTPUT
;;
copilot-swe-agent\[bot\])
echo "GH_PAT=${{ secrets.SKYVERN_CLOUD_GH_PAT }}" >> $GITHUB_OUTPUT
;;
*)
echo "GH_PAT=${{ secrets.SKYVERN_CLOUD_GH_PAT }}" >> $GITHUB_OUTPUT
echo "Author $PR_AUTHOR is not in the approved list"
;;
esac
- name: Auto-merge PR
env:
GH_TOKEN: ${{ steps.set-token.outputs.GH_PAT }}
run: |
gh pr merge ${{ github.event.pull_request.number }} \
--squash \
--admin \
--repo "${{ github.repository }}"