From d9622ba2cfd458f7d93e0e3a066a1ce027d49ae0 Mon Sep 17 00:00:00 2001 From: Mark Lawrence Date: Thu, 19 Sep 2024 21:06:20 +0000 Subject: [PATCH] ci: auto merge dependabot prs --- .github/dependabot.yml | 2 -- .github/workflows/dependabot-merge.yml | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dependabot-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 89fe43d..22cbb89 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,5 +7,3 @@ updates: schedule: interval: "daily" open-pull-requests-limit: 0 # only create PRs for security updates - reviewers: - - "Mark-j-Lawrence" diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml new file mode 100644 index 0000000..3689a19 --- /dev/null +++ b/.github/workflows/dependabot-merge.yml @@ -0,0 +1,23 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'cicsdev/cics-security-sdv-samples' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}}