-
Notifications
You must be signed in to change notification settings - Fork 128
63 lines (52 loc) · 1.8 KB
/
dependabot-auto-merge.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
59
60
61
62
63
name: Merge dependabot PRs for minor/patch updates
on:
pull_request:
branches:
- master
permissions:
contents: write
pull-requests: write
jobs:
pr-tests:
name: Install, lint, test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
os: [ubuntu-latest, windows-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
if: ${{ github.actor == 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'minor') || contains(github.event.pull_request.labels.*.name, 'patch') ) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Install
run: npm ci
- name: Lint
run: npm run lint:ci
- name: Unit tests
run: npm test --workspaces
- name: E2E tests
run: npm run test:e2e
merge-pr-to-next:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
os: [ubuntu-latest]
if: ${{ github.actor == 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'minor') || contains(github.event.pull_request.labels.*.name, 'patch') ) }}
steps:
- name: Approve dependabot PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
# The documentation incorrectly forgets `GITHUB_TOKEN` here.
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}