|
1 | | -name: Dependabot Pull Request Approve and Merge |
| 1 | +name: Dependabot Pull Request Rename |
2 | 2 | on: pull_request #_target |
3 | 3 | permissions: |
4 | 4 | pull-requests: write |
|
32 | 32 | parensClose="):" |
33 | 33 | pr_title=$title_pt1$parensOpen$packagename$parensClose$title_pt2 |
34 | 34 | gh pr edit "$PR_URL" --title "$pr_title" |
35 | | -
|
36 | | - # Auto merge Dependabot PRs for: |
37 | | - # - patch updates on prod dependencies |
38 | | - # - minor updates on dev dependencies |
39 | | - dependabot-auto-merge: |
40 | | - needs: pull-request-title-change |
41 | | - # Only run for Dependabot PRs |
42 | | - if: ${{ github.actor == 'dependabot[bot]' }} |
43 | | - runs-on: ubuntu-latest |
44 | | - steps: |
45 | | - - name: 'Do not auto-merge' |
46 | | - run: exit 0 |
47 | | - |
48 | | - - name: 'Fetch Dependabot metadata' |
49 | | - id: dependabot |
50 | | - uses: dependabot/fetch-metadata@v2 |
51 | | - |
52 | | - - name: 'Check auto merge conditions' |
53 | | - id: auto-merge |
54 | | - if: | |
55 | | - ( |
56 | | - steps.dependabot.outputs.update-type == 'version-update:semver-patch' && |
57 | | - contains('direct:production,indirect:production', steps.dependabot.outputs.dependency-type) |
58 | | - ) || ( |
59 | | - contains('version-update:semver-minor,version-update:semver-patch', steps.dependabot.outputs.update-type) && |
60 | | - contains('direct:development,indirect:development', steps.dependabot.outputs.dependency-type) |
61 | | - ) |
62 | | - run: echo "::notice ::auto-merge conditions satisfied" |
63 | | - |
64 | | - - name: 'Approve and merge PR' |
65 | | - if: ${{ steps.auto-merge.conclusion == 'success' }} |
66 | | - run: | |
67 | | - gh pr review --approve "$PR_URL" |
68 | | - gh pr merge --auto --squash "$PR_URL" |
69 | | - env: |
70 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
71 | | - PR_URL: ${{ github.event.pull_request.html_url }} |
0 commit comments