generated from ericvera/ts-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (44 loc) · 1.31 KB
/
dependabot.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
name: Dependabot auto-merge
on:
pull_request:
branches:
- main
# Cancel if there is a build for the same branch running
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Node version
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: yarn
- name: Lint
run: yarn lint
- name: Run tests
run: yarn test
- name: Build
run: yarn build
# You can remove the next 2 steps to disable auto-merge.
# These will fail if auto-merge is not enabled for the account repo.
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Enable auto-merge for Dependabot PRs
if: startsWith(steps.metadata.outputs.update-type, 'version-update:semver')
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}