diff --git a/.github/workflows/dependabot-github-actions-automerge.yml b/.github/workflows/dependabot-github-actions-automerge.yml new file mode 100644 index 0000000..c9ce03f --- /dev/null +++ b/.github/workflows/dependabot-github-actions-automerge.yml @@ -0,0 +1,26 @@ +name: Dependabot GitHub Actions Auto Merge + +on: + pull_request: + paths: + - '.github/workflows/**' + branches: [ main ] + +permissions: + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + needs: build + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v2 + - name: Enable auto-merge for Dependabot PRs + if: ${{steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bc68392..e40a402 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -9,12 +9,10 @@ on: pull_request: paths: - 'src/**' - - '.github/workflows/**' branches: [ main ] permissions: pull-requests: write - contents: write jobs: build: @@ -69,7 +67,7 @@ jobs: id: dependabot-metadata uses: dependabot/fetch-metadata@v2 - name: Enable auto-merge for Dependabot PRs - if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions'}} + if: ${{steps.dependabot-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}}