Skip to content

Commit bd77e7c

Browse files
committed
fix: dev: use gh cli for both approve and merge ala this action [1]
[1] https://github.com/bgalek/dependabot-automerge Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
1 parent fb7874e commit bd77e7c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/autobot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ jobs:
1616
PR_URL: ${{ github.event.pull_request.html_url }}
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
runs-on: ubuntu-latest
19-
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
19+
2020
steps:
2121
- name: Fetch Dependabot metadata
2222
id: metadata
23+
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
2324
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
2425
with:
2526
github-token: "${{ secrets.GITHUB_TOKEN }}"
2627

2728
- name: Enable auto-approve for Dependabot PRs
29+
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
2830
run: gh pr review --approve "${PR_URL}"
31+
32+
- name: Enable auto-approve for Dependabot PRs
33+
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
34+
run: gh pr merge --squash --auto "${PR_URL}" || gh pr merge --merge --auto "${PR_URL}" || gh pr merge --rebase --auto "${PR_URL}"

0 commit comments

Comments
 (0)