Skip to content

Commit

Permalink
feat: Automates dependabot PR review and merge (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
saltiyazan committed Mar 12, 2024
1 parent 028e943 commit e92ad10
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 @@ -7,6 +7,10 @@ on:
# The branches below must be a subset of the branches above
branches: ["main"]

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:
lint-report:
name: Lint report
Expand Down

0 comments on commit e92ad10

Please sign in to comment.