Skip to content

Commit f1f6cef

Browse files
Copilotmolvqingtai
andcommitted
refactor: simplify dependabot auto-merge workflow
Co-authored-by: molvqingtai <26295698+molvqingtai@users.noreply.github.com>
1 parent dd1db87 commit f1f6cef

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

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

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,8 @@ permissions:
99
pull-requests: write
1010

1111
jobs:
12-
auto-approve:
13-
runs-on: ubuntu-latest
14-
if: github.actor == 'dependabot[bot]'
15-
steps:
16-
- name: Dependabot metadata
17-
id: metadata
18-
uses: dependabot/fetch-metadata@v2
19-
with:
20-
github-token: '${{ secrets.GITHUB_TOKEN }}'
21-
22-
- name: Approve PR
23-
run: gh pr review --approve "$PR_URL"
24-
env:
25-
PR_URL: ${{ github.event.pull_request.html_url }}
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
2812
auto-merge:
2913
runs-on: ubuntu-latest
30-
needs: auto-approve
3114
if: github.actor == 'dependabot[bot]'
3215
steps:
3316
- name: Dependabot metadata
@@ -37,7 +20,9 @@ jobs:
3720
github-token: '${{ secrets.GITHUB_TOKEN }}'
3821

3922
- name: Enable auto-merge for minor and patch updates
40-
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
23+
if: |
24+
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
25+
steps.metadata.outputs.update-type == 'version-update:semver-patch'
4126
run: gh pr merge --auto --squash "$PR_URL"
4227
env:
4328
PR_URL: ${{ github.event.pull_request.html_url }}

0 commit comments

Comments
 (0)