Skip to content

Commit b632c58

Browse files
authored
Fix dependabot auto merge workflow (#1465)
1 parent c40888b commit b632c58

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,30 @@ jobs:
1313
runs-on: ubuntu-latest
1414
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'jfrog/jfrog-cli-core'
1515
steps:
16+
- name: Checkout PR code
17+
uses: actions/checkout@v5
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
1622
- name: Add 'ignore for release' label
1723
run: |
1824
gh pr edit ${{ github.event.pull_request.number }} --add-label "ignore for release"
1925
env:
2026
GH_TOKEN: ${{ secrets.CLI_ACTION_TOKEN }}
2127

28+
- name: Approve PR
29+
run: gh pr review --approve "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GH_TOKEN: ${{secrets.CLI_ACTION_TOKEN}}
33+
2234
- name: Dependabot metadata
2335
id: metadata
2436
uses: dependabot/fetch-metadata@v2.4.0
2537
with:
2638
github-token: "${{ secrets.GITHUB_TOKEN }}"
2739

28-
- name: Checkout PR code
29-
if: steps.metadata.outputs.dependency-group == 'go'
30-
uses: actions/checkout@v5
31-
with:
32-
ref: ${{ github.event.pull_request.head.sha }}
33-
token: ${{ secrets.GITHUB_TOKEN }}
34-
3540
- name: Run make update-all for go dependencies
3641
if: steps.metadata.outputs.dependency-group == 'go'
3742
run: make update-all
@@ -47,12 +52,6 @@ jobs:
4752
git push
4853
fi
4954
50-
- name: Approve PR
51-
run: gh pr review --approve "$PR_URL"
52-
env:
53-
PR_URL: ${{github.event.pull_request.html_url}}
54-
GH_TOKEN: ${{secrets.CLI_ACTION_TOKEN}}
55-
5655
- name: Enable auto-merge for Dependabot PRs
5756
run: gh pr merge --auto --squash "$PR_URL"
5857
env:

0 commit comments

Comments
 (0)