GeezerVison is showing github.com — meta: notify slack when someone force pushes · nodejs/node@e0df3bc
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +25Lines changed: 25 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: |
| 4 | + - master |
| 5 | + |
| 6 | +name: Notify on Force Push |
| 7 | +jobs: |
| 8 | + slackNotification: |
| 9 | + name: Slack Notification |
| 10 | + if: ${{ github.event.forced && github.repository == 'nodejs/node' }} |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Slack Notification |
| 14 | + uses: rtCamp/action-slack-notify@master |
| 15 | + env: |
| 16 | + SLACK_COLOR: '#DE512A' |
| 17 | + SLACK_ICON: https://github.com/nodejs.png?size=48 |
| 18 | + SLACK_TITLE: '${{ github.actor }} force-pushed to ${{ github.ref }}' |
| 19 | + SLACK_MESSAGE: | |
| 20 | + A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/master|${{ github.repository }}@master> by <https://github.com/${{ github.actor }}|${{ github.actor }}> |
| 21 | +
|
| 22 | + Before: <https://github.com/${{ github.repository }}/commit/${{ github.event.before }}|${{ github.event.before }}> |
| 23 | + After: <https://github.com/${{ github.repository }}/commit/${{ github.event.after }}|${{ github.event.after }}> |
| 24 | + SLACK_USERNAME: nodejs-bot |
| 25 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |