Skip to content

Commit eca2df0

Browse files
mmarchinidanielleadams
authored andcommitted
meta: notify slack when someone force pushes
Notify #nodejs-dev on the OpenJS Foundation slack when someone force-pushes, removing one manual step from force-pushing. PR-URL: #35131 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 4e0995b commit eca2df0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 }}

0 commit comments

Comments
 (0)