-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (66 loc) · 2.18 KB
/
dependabot-auto-merge.yaml
File metadata and controls
78 lines (66 loc) · 2.18 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
name: Auto-merge Dependabot PRs
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
jobs:
dependabot-make-update:
# Only run on Dependabot PRs
if: github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install poetry
run: python -m pip install --upgrade pip setuptools wheel poetry
- name: Install project dependencies
run: make install-ci
- name: Update dependencies (make update)
run: make update
- name: Lint (make lint)
run: make lint
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git status --porcelain | grep .; then
git add -A
git commit -m "mesh-2092: apply make update changes"
git push
else
echo "No changes to commit"
fi
enable-automerge:
# Only run on Dependabot PRs after make update succeeds
if: github.event.pull_request.user.login == 'dependabot[bot]'
needs: dependabot-make-update
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}