Skip to content

Commit e7ad55f

Browse files
author
Nikolai Emil Damm
committed
refactor(workflows): replace auto-merge job with reusable workflow call
Signed-off-by: Nikolai Emil Damm <neq@energinet.dk>
1 parent e66ba5c commit e7ad55f

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

.github/workflows/auto-merge.yaml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,5 @@ permissions:
66
pull-requests: write
77

88
jobs:
9-
auto-approve:
10-
runs-on: ubuntu-latest
11-
permissions:
12-
pull-requests: write
13-
if: github.actor == 'dependabot[bot]'
14-
steps:
15-
- uses: hmarr/auto-approve-action@v4
16-
dependabot:
17-
runs-on: ubuntu-latest
18-
if: github.actor == 'dependabot[bot]'
19-
steps:
20-
- name: Dependabot metadata
21-
id: metadata
22-
uses: dependabot/fetch-metadata@v2
23-
with:
24-
github-token: "${{ secrets.GITHUB_TOKEN }}"
25-
- name: Approve pull request
26-
run: |
27-
# Use GitHub API to approve the pull request
28-
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
29-
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews" \
30-
-d '{"event": "APPROVE"}'
31-
- name: Enable auto-merge for Dependabot PRs
32-
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type != 'version-update:semver-major'
33-
run: gh pr merge --auto --squash "$PR_URL"
34-
env:
35-
PR_URL: ${{github.event.pull_request.html_url}}
36-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
9+
call-auto-merge-workflow:
10+
uses: devantler-tech/.github/.github/workflows/auto-merge.yaml@main

0 commit comments

Comments
 (0)