|
28 | 28 | github-token:"${{ secrets.GITHUB_TOKEN }}" |
29 | 29 |
|
30 | 30 | -name:Approve the PR |
| 31 | +if:steps.metadata.outputs.package-ecosystem != 'github-actions' |
31 | 32 | run:| |
32 | 33 | echo "Approving $PR_URL" |
33 | 34 | gh pr review --approve "$PR_URL" |
|
36 | 37 | GH_TOKEN:${{secrets.GITHUB_TOKEN}} |
37 | 38 |
|
38 | 39 | -name:Enable auto-merge |
| 40 | +if:steps.metadata.outputs.package-ecosystem != 'github-actions' |
39 | 41 | run:| |
40 | 42 | echo "Enabling auto-merge for $PR_URL" |
41 | 43 | gh pr merge --auto --squash "$PR_URL" |
|
45 | 47 |
|
46 | 48 | -name:Send Slack notification |
47 | 49 | run:| |
| 50 | + if [ "$PACKAGE_ECOSYSTEM" = "github-actions" ]; then |
| 51 | + STATUS_TEXT=":pr-opened: Dependabot opened PR #${PR_NUMBER} (GitHub Actions changes are not auto-merged)" |
| 52 | + else |
| 53 | + STATUS_TEXT=":pr-merged: Auto merge enabled for Dependabot PR #${PR_NUMBER}" |
| 54 | + fi |
48 | 55 | curl -X POST -H 'Content-type: application/json' \ |
49 | 56 | --data '{ |
50 | 57 | "username": "dependabot", |
|
54 | 61 | "type": "header", |
55 | 62 | "text": { |
56 | 63 | "type": "plain_text", |
57 | | - "text": ":pr-merged: Auto merge enabled for Dependabot PR #'"${PR_NUMBER}"'", |
| 64 | + "text": "'"${STATUS_TEXT}"'", |
58 | 65 | "emoji":true |
59 | 66 | } |
60 | 67 | }, |
|
84 | 91 | }' "${{ secrets.DEPENDABOT_PRS_SLACK_WEBHOOK }}" |
85 | 92 | env: |
86 | 93 | SLACK_WEBHOOK:${{ secrets.DEPENDABOT_PRS_SLACK_WEBHOOK }} |
| 94 | +PACKAGE_ECOSYSTEM:${{ steps.metadata.outputs.package-ecosystem }} |
87 | 95 | PR_NUMBER:${{ github.event.pull_request.number }} |
88 | 96 | PR_TITLE:${{ github.event.pull_request.title }} |
89 | 97 | PR_URL:${{ github.event.pull_request.html_url }} |