Skip to content

Commit

Permalink
feat: Automates dependabot PR review and merge (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
saltiyazan authored Mar 13, 2024
1 parent 1a7dd23 commit 247183c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/dependabot_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Dependabot Auto Approve and Merge"

on:
pull_request:

permissions:
pull-requests: write
contents: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
# This step will allow Github to auto-merge the PR if branch protection rules are satisfied.
# Branch protection rules should require status checks to pass before merging including all required workflows.
- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
schedule:
- cron: '0 8 * * 2'

concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('ignore-main-{0}', github.run_id) || format('{0}-{1}', github.workflow, github.ref_name) }}
cancel-in-progress: true

jobs:

build:
Expand Down

0 comments on commit 247183c

Please sign in to comment.