From cbd132109b29bafeb90fd95f80691f966306d194 Mon Sep 17 00:00:00 2001 From: javierzazo_microsoft Date: Mon, 11 Nov 2024 11:01:33 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20automerge=20capabilit?= =?UTF-8?q?ies=20to=20dependabot=20of=20minor=20and=20patch=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.github/workflows/automerge.yml.jinja | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 template/.github/workflows/automerge.yml.jinja diff --git a/template/.github/workflows/automerge.yml.jinja b/template/.github/workflows/automerge.yml.jinja new file mode 100644 index 0000000..e0d55cc --- /dev/null +++ b/template/.github/workflows/automerge.yml.jinja @@ -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 == '{{organization}}/{{project_name}}' + 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' || steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}}