|
1 | 1 | name: Dependabot auto-merge |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request_target: |
5 | | - types: [opened, reopened, synchronize, ready_for_review] |
| 4 | + pull_request_target: |
| 5 | + types: [opened, reopened, synchronize, ready_for_review] |
6 | 6 |
|
7 | 7 | concurrency: |
8 | | - group: dependabot-auto-merge-${{ github.event.pull_request.number }} |
9 | | - cancel-in-progress: true |
| 8 | + group: dependabot-auto-merge-${{ github.event.pull_request.number }} |
| 9 | + cancel-in-progress: true |
10 | 10 |
|
11 | 11 | permissions: |
12 | | - contents: write |
13 | | - pull-requests: write |
| 12 | + contents: write |
| 13 | + pull-requests: write |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - auto-merge: |
17 | | - name: Auto-merge safe Dependabot updates |
18 | | - if: github.event.pull_request.user.login == 'dependabot[bot]' && !github.event.pull_request.draft |
19 | | - runs-on: ubuntu-24.04 |
20 | | - steps: |
21 | | - - name: Fetch Dependabot metadata |
22 | | - id: metadata |
23 | | - uses: dependabot/fetch-metadata@v3 |
24 | | - with: |
25 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
| 16 | + auto-merge: |
| 17 | + name: Auto-merge safe Dependabot updates |
| 18 | + if: github.event.pull_request.user.login == 'dependabot[bot]' && !github.event.pull_request.draft |
| 19 | + runs-on: ubuntu-24.04 |
| 20 | + steps: |
| 21 | + - name: Fetch Dependabot metadata |
| 22 | + id: metadata |
| 23 | + uses: dependabot/fetch-metadata@v3 |
| 24 | + with: |
| 25 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + - uses: actions/checkout@v6 |
| 27 | + - name: Approve eligible Dependabot updates |
| 28 | + if: > |
| 29 | + (steps.metadata.outputs.package-ecosystem == 'github_actions' || |
| 30 | + steps.metadata.outputs.package-ecosystem == 'github-actions') || |
| 31 | + (steps.metadata.outputs.package-ecosystem == 'docker' && |
| 32 | + steps.metadata.outputs.dependency-group == 'metabase' && |
| 33 | + (steps.metadata.outputs.update-type == 'version-update:semver-patch' || |
| 34 | + steps.metadata.outputs.update-type == 'version-update:semver-minor')) |
| 35 | + run: bash .github/scripts/approve-dependabot-pr.sh "$PR_URL" |
| 36 | + env: |
| 37 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + PR_URL: ${{ github.event.pull_request.html_url }} |
26 | 39 |
|
27 | | - - name: Approve safe GitHub Actions updates |
28 | | - if: > |
29 | | - steps.metadata.outputs.package-ecosystem == 'github-actions' && |
30 | | - (steps.metadata.outputs.update-type == 'version-update:semver-patch' || |
31 | | - steps.metadata.outputs.update-type == 'version-update:semver-minor') |
32 | | - run: bash .github/scripts/approve-dependabot-pr.sh "$PR_URL" |
33 | | - env: |
34 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
35 | | - PR_URL: ${{ github.event.pull_request.html_url }} |
36 | | - |
37 | | - - name: Enable auto-merge for safe GitHub Actions updates |
38 | | - if: > |
39 | | - steps.metadata.outputs.package-ecosystem == 'github-actions' && |
40 | | - (steps.metadata.outputs.update-type == 'version-update:semver-patch' || |
41 | | - steps.metadata.outputs.update-type == 'version-update:semver-minor') |
42 | | - run: gh pr merge --auto --squash "$PR_URL" |
43 | | - env: |
44 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
45 | | - PR_URL: ${{ github.event.pull_request.html_url }} |
| 40 | + - name: Enable auto-merge for eligible Dependabot updates |
| 41 | + if: > |
| 42 | + (steps.metadata.outputs.package-ecosystem == 'github_actions' || |
| 43 | + steps.metadata.outputs.package-ecosystem == 'github-actions') || |
| 44 | + (steps.metadata.outputs.package-ecosystem == 'docker' && |
| 45 | + steps.metadata.outputs.dependency-group == 'metabase' && |
| 46 | + (steps.metadata.outputs.update-type == 'version-update:semver-patch' || |
| 47 | + steps.metadata.outputs.update-type == 'version-update:semver-minor')) |
| 48 | + run: gh pr merge --auto --squash "$PR_URL" |
| 49 | + env: |
| 50 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + PR_URL: ${{ github.event.pull_request.html_url }} |
0 commit comments