Skip to content

Commit 7dc4fd1

Browse files
committed
added permission for automerge dependabot PRs
1 parent 7aefc81 commit 7dc4fd1

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: CI
2-
2+
permissions:
3+
contents: write
4+
pull-requests: write
35
on:
46
push:
57
branches:
@@ -50,6 +52,18 @@ jobs:
5052
github_token: ${{ secrets.GITHUB_TOKEN }}
5153
publish_dir: .
5254

55+
dependabot:
56+
name: 'Dependabot'
57+
needs: build # After the E2E and build jobs, if one of them fails, it won't merge the PR.
58+
runs-on: ubuntu-latest
59+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} # Detect that the PR author is dependabot
60+
steps:
61+
- name: Enable auto-merge for Dependabot PRs
62+
run: gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR
63+
env:
64+
PR_URL: ${{github.event.pull_request.html_url}}
65+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
66+
5367
npm-publish-build:
5468
needs: build
5569
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)