-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (49 loc) · 1.38 KB
/
automerge.yaml
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
name: Auto Merge
on:
pull_request:
types: [labeled]
permissions:
pull-requests: write
issues: write
repository-projects: write
jobs:
front:
runs-on : ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: run front end build
working-directory: ./frontend/code
run: npm ci && npm run build
back:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: run backend build
working-directory: ./backend/code
run : npm ci && npm run build
label:
runs-on: ubuntu-latest
permissions: write-all
needs: [front, back]
steps:
- name: Generate token
id: generate_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.CLIENT_SECRET }}
- name: Use token
run : echo "save token"
env:
TOKEN: ${{ steps.generate_token.outputs.token }}
- name: Get PR URL
run: echo "PR_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
- name: Add automerge label
run: |
gh pr edit $PR_URL --add-label "automerge"
gh pr merge --auto --merge "$PR_URL"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_URL: ${{ github.event.pull_request.html_url }}