-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (66 loc) · 2 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
with:
ref: ${{ github.event.pull_request.head.sha }}
- 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
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v3
- name: run backend build
working-directory: ./backend/code
run : npm ci && npm run build
docker:
runs-on: ubuntu-latest
steps:
- uses : actions/checkout@v3
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name : run docker
run : docker compose up --build -d
label:
if : github.event.pull_request.user.login == 'ismail-kharrobi' || github.event.pull_request.user.login == 'Wadie-ess' || github.event.pull_request.user.login == 'sedeve'
runs-on: ubuntu-latest
permissions: write-all
needs: [front, back,docker]
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 label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: automerge
- name: merge
run: |
gh pr merge --auto --merge "$PR_URL"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_URL: ${{ github.event.pull_request.html_url }}