|
1 | 1 | # from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml |
2 | 2 | name: Dependabot auto-merge |
3 | 3 | on: |
4 | | - pull_request |
5 | | - |
6 | | -permissions: |
7 | | - contents: write |
8 | | - pull-requests: write |
| 4 | + pull_request_target: |
9 | 5 |
|
10 | 6 | jobs: |
11 | | - wait_for_checks: |
12 | | - runs-on: ubuntu-latest |
13 | | - if: ${{ github.actor == 'dependabot[bot]' }} |
14 | | - steps: |
15 | | - - name: Wait for check is finished |
16 | | - uses: lewagon/wait-on-check-action@v1.2.0 |
17 | | - id: wait_for_checks |
18 | | - with: |
19 | | - ref: ${{ github.event.pull_request.head.sha || github.sha }} |
20 | | - running-workflow-name: wait_for_checks |
21 | | - check-regexp: test |
22 | | - wait-interval: 10 |
23 | | - env: |
24 | | - REPO_TOKEN: ${{ secrets.MATZBOT_GITHUB_TOKEN }} |
25 | | - dependabot: |
26 | | - needs: [wait_for_checks] |
27 | | - name: Dependabot auto-merge |
| 7 | + automerge: |
28 | 8 | runs-on: ubuntu-latest |
29 | 9 | if: ${{ github.actor == 'dependabot[bot]' }} |
30 | 10 | steps: |
31 | 11 | - name: Dependabot metadata |
| 12 | + uses: dependabot/fetch-metadata@v1 |
32 | 13 | id: metadata |
33 | | - uses: dependabot/fetch-metadata@v1.3.6 |
| 14 | + - name: Wait for status checks |
| 15 | + uses: lewagon/wait-on-check-action@v1.2.0 |
34 | 16 | with: |
35 | | - github-token: "${{ secrets.MATZBOT_GITHUB_TOKEN }}" |
36 | | - - name: Enable auto-merge for Dependabot PRs |
37 | | - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} |
38 | | - run: | |
39 | | - gh pr merge --auto --merge "$PR_URL" |
| 17 | + repo-token: ${{ secrets.MATZBOT_GITHUB_TOKEN }} |
| 18 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 19 | + check-regexp: test* |
| 20 | + wait-interval: 30 |
| 21 | + - name: Auto-merge for Dependabot PRs |
| 22 | + if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} |
| 23 | + run: gh pr merge --auto --merge "$PR_URL" |
40 | 24 | env: |
41 | 25 | PR_URL: ${{github.event.pull_request.html_url}} |
42 | | - GITHUB_TOKEN: ${{secrets.MATZBOT_GITHUB_TOKEN}} |
| 26 | + GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_TOKEN }} |
0 commit comments