|
|
@@ -0,0 +1,27 @@
|
|
|
+name: Dependabot auto-merge
|
|
|
+
|
|
|
+on: pull_request
|
|
|
+
|
|
|
+permissions:
|
|
|
+ contents: write
|
|
|
+ pull-requests: write
|
|
|
+
|
|
|
+jobs:
|
|
|
+ dependabot:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ if: github.actor == 'dependabot[bot]'
|
|
|
+ steps:
|
|
|
+ - name: Fetch dependabot metadata
|
|
|
+ id: metadata
|
|
|
+ uses: dependabot/fetch-metadata@v2
|
|
|
+ with:
|
|
|
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
+
|
|
|
+ - name: Approve and enable auto-merge for minor/patch updates
|
|
|
+ if: steps.metadata.outputs.update-type != 'version-update:semver-major'
|
|
|
+ env:
|
|
|
+ PR_URL: ${{ github.event.pull_request.html_url }}
|
|
|
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
+ run: |
|
|
|
+ gh pr review --approve "$PR_URL"
|
|
|
+ gh pr merge --auto --squash "$PR_URL"
|