Skip to content

Commit 6d7bb9b

Browse files
committed
Updated automerge workflow
1 parent 42f9bfa commit 6d7bb9b

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed
Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
name: "Dependabot Auto Merge"
1+
ame: Dependabot auto-merge
2+
on: pull_request
23

3-
on:
4-
workflow_run:
5-
types:
6-
- "completed"
7-
workflows:
8-
- 'Test Suite'
4+
permissions:
5+
contents: write
6+
pull-requests: write
97

108
jobs:
11-
merge-me:
12-
name: Merge me!
9+
dependabot:
1310
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
1412
steps:
15-
- # It is often a desired behavior to merge only when a workflow execution
16-
# succeeds. This can be changed as needed.
17-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18-
name: Merge me!
19-
uses: ridedott/merge-me-action@v2
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v1
2016
with:
21-
# Depending on branch protection rules, a manually populated
22-
# `GITHUB_TOKEN_WORKAROUND` secret with permissions to push to
23-
# a protected branch must be used. This secret can have an arbitrary
24-
# name, as an example, this repository uses `DOTTBOTT_TOKEN`.
25-
#
26-
# When using a custom token, it is recommended to leave the following
27-
# comment for other developers to be aware of the reasoning behind it:
28-
#
29-
# This must be used as GitHub Actions token does not support pushing
30-
# to protected branches.
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
- name: Enable auto-merge for Dependabot PRs
19+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
20+
run: gh pr merge --auto --merge "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)