Skip to content

Commit cf2e16d

Browse files
Merge pull request #212 from NHSDigital/mesh-2092-create-automerge-workflow
mesh-2092: workflow pushes changes
2 parents f4fbcae + d94909f commit cf2e16d

1 file changed

Lines changed: 7 additions & 30 deletions

File tree

.github/workflows/dependabot-auto-merge.yaml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,9 @@ on:
1010
- labeled
1111

1212
jobs:
13-
dependabot-make-update:
14-
# Only run on Dependabot PRs
15-
if: github.event.pull_request.user.login == 'dependabot[bot]'
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Install Python 3.11
25-
uses: actions/setup-python@v4
26-
with:
27-
python-version: '3.11'
28-
29-
- name: Install poetry
30-
run: python -m pip install --upgrade pip setuptools wheel poetry
31-
32-
- name: Install project dependencies
33-
run: make install-ci
34-
35-
- name: Update dependencies (make update)
36-
run: make update
37-
38-
- name: Lint (make lint)
39-
run: make lint
40-
4113
enable-automerge:
42-
# Only run on Dependabot PRs after make update succeeds
14+
# Only run on Dependabot PRs
4315
if: github.event.pull_request.user.login == 'dependabot[bot]'
44-
needs: dependabot-make-update
4516
runs-on: ubuntu-latest
4617
permissions:
4718
contents: write
@@ -54,6 +25,12 @@ jobs:
5425
with:
5526
github-token: ${{ secrets.GITHUB_TOKEN }}
5627

28+
- name: Auto-approve Dependabot PR
29+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
30+
uses: hmarr/auto-approve-action@v4
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
5734
- name: Enable auto-merge for Dependabot PRs
5835
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
5936
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)