@@ -14,40 +14,44 @@ runs:
1414 # Based on: https://nicolasiensen.github.io/2022-07-23-automating-dependency-updates-with-dependabot-github-auto-merge-and-github-actions/
1515 steps :
1616 - name : user-ineligible-PR-notice
17- if : ${{ github.event.pull_request.user.login != inputs.required-pr-user-login }}
17+ if : github.event.pull_request.user.login != inputs.required-pr-user-login
1818 shell : bash
1919 run : echo "This is *not* a PR authored by '${{ inputs.required-pr-user-login }}', ignoring." >> $GITHUB_STEP_SUMMARY
2020 - name : user-eligible-PR-notice
21- if : ${{ github.event.pull_request.user.login == inputs.required-pr-user-login }}
21+ if : github.event.pull_request.user.login == inputs.required-pr-user-login
2222 shell : bash
2323 run : echo "This *is* a PR authored by '${{ inputs.required-pr-user-login }}', inspecting." >> $GITHUB_STEP_SUMMARY
2424 - name : Dependabot metadata
25- if : ${{ github.event.pull_request.user.login == inputs.required-pr-user-login }}
25+ if : github.event.pull_request.user.login == inputs.required-pr-user-login
2626 id : dependabot-metadata
2727 uses : dependabot/fetch-metadata@v1.6.0
2828 - name : Enable auto-merge for Dependabot PRs
29- if : ${{ github.event.pull_request.user.login == inputs.required-pr-user-login }}
30- run : gh pr merge --auto --merge "$PR_URL"
29+ if : github.event.pull_request.user.login == inputs.required-pr-user-login
3130 env :
32- PR_URL : ${{ github.event.pull_request.html_url }}
33- GITHUB_TOKEN : ${{ inputs.github_token }}
31+ PR_URL : " ${{ github.event.pull_request.html_url }}"
32+ GITHUB_TOKEN : " ${{ inputs.github_token }}"
33+ shell : bash
34+ run : gh pr merge --auto --merge "$PR_URL"
3435 - name : Approve patch and minor updates
3536 if : ${{ (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor') && (github.event.pull_request.user.login == inputs.required-pr-user-login) }}
36- run : gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**"
3737 env :
38- PR_URL : ${{github.event.pull_request.html_url}}
39- GITHUB_TOKEN : ${{ inputs.github_token }}
38+ PR_URL : " ${{ github.event.pull_request.html_url }}"
39+ GITHUB_TOKEN : " ${{ inputs.github_token }}"
40+ shell : bash
41+ run : gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**"
4042 - name : Approve major updates of development dependencies
4143 if : ${{ (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:development') && (github.event.pull_request.user.login == inputs.required-pr-user-login) }}
42- run : gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a major update of a dependency used only in development**"
4344 env :
44- PR_URL : ${{github.event.pull_request.html_url}}
45- GITHUB_TOKEN : ${{ inputs.github_token }}
45+ PR_URL : " ${{ github.event.pull_request.html_url }}"
46+ GITHUB_TOKEN : " ${{ inputs.github_token }}"
47+ shell : bash
48+ run : gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a major update of a dependency used only in development**"
4649 - name : Comment on major updates of non-development dependencies
4750 if : ${{ (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:production') && (github.event.pull_request.user.login == inputs.required-pr-user-login) }}
51+ env :
52+ PR_URL : " ${{ github.event.pull_request.html_url }}"
53+ GITHUB_TOKEN : " ${{ inputs.github_token }}"
54+ shell : bash
4855 run : |
4956 gh pr comment $PR_URL --body "I'm **not approving** this PR because **it includes a major update of a dependency used in production**"
5057 gh pr edit $PR_URL --add-label "requires-manual-qa"
51- env :
52- PR_URL : ${{ github.event.pull_request.html_url }}
53- GITHUB_TOKEN : ${{ inputs.github_token }}
0 commit comments