Skip to content

Commit

Permalink
fet(pdf-remo): dependent bot auto merge yml
Browse files Browse the repository at this point in the history
  • Loading branch information
otaku0304 committed Oct 6, 2024
1 parent 696dc5e commit 1833a3f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Auto-merge Dependabot PRs

on:
pull_request:
types:
- opened
- synchronize

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' # Trigger only for Dependabot PRs

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get Dependabot compatibility score
run: |
pr_url="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}"
compatibility_score=$(curl -s "$pr_url" | jq -r '.head.repo.compatibility_score')
echo "Compatibility score is $compatibility_score"
- name: Check compatibility score and auto-merge
run: |
if [[ $compatibility_score == "100" ]]; then
echo "Compatibility score is 100%, auto-merging..."
gh pr merge ${{ github.event.pull_request.number }} --auto --squash --delete-branch
else
echo "Compatibility score is not 100%, skipping auto-merge."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ updates:
- dependency-name: "@angular*"
update-types:
- "version-update:semver-major"

0 comments on commit 1833a3f

Please sign in to comment.