From 1833a3f04799ca5ff570571b6d54e7747b528673 Mon Sep 17 00:00:00 2001 From: otaku0304 <107242846+otaku0304@users.noreply.github.com> Date: Sun, 6 Oct 2024 08:30:02 +0530 Subject: [PATCH] fet(pdf-remo): dependent bot auto merge yml --- .github/dependabot-auto-merge.yml | 33 +++++++++++++++++++++++++++++++ .github/dependabot.yml | 1 + 2 files changed, 34 insertions(+) create mode 100644 .github/dependabot-auto-merge.yml diff --git a/.github/dependabot-auto-merge.yml b/.github/dependabot-auto-merge.yml new file mode 100644 index 0000000..c2ab9ff --- /dev/null +++ b/.github/dependabot-auto-merge.yml @@ -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 }} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 44ca3bf..b1935bc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,3 +23,4 @@ updates: - dependency-name: "@angular*" update-types: - "version-update:semver-major" +