From 3ad31e3572c0c2cb22e43b7175960b91c1fbddf6 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:32:23 +0200 Subject: [PATCH] chore(auto-merge): replace workflow (#11) Source: https://github.com/mdn/yari/blob/ec98d9979f7e146455dcdb2297d339bd9eb4d08c/.github/workflows/auto-merge.yml --- .github/workflows/auto-merge.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 2363fc5..531f5c1 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -1,10 +1,24 @@ -name: "auto-merge" -on: [pull_request_target] +name: auto-merge + +on: + pull_request_target: + branches: + - main jobs: auto-merge: - uses: mdn/workflows/.github/workflows/auto-merge.yml@main - with: - target-repo: "mdn/mdn-http-observatory" - secrets: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + + steps: + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.AUTOMERGE_TOKEN }} + + - name: Squash and merge + if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' }} + env: + GITHUB_TOKEN: ${{ secrets.AUTOMERGE_TOKEN }} + run: gh pr comment ${{ github.event.pull_request.html_url }} --body "@dependabot squash and merge"