Skip to content

Commit 8c3512f

Browse files
Introduce notify-on-force-push workflow (#7322)
add workflow
1 parent bad2b2f commit 8c3512f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
name: Notify on Push
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
notify_on_push:
12+
name: Notify on Force Push on `main`
13+
if: github.repository == 'nodejs/nodejs.org' && github.event.forced
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Slack Notification
17+
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # 2.3.2
18+
env:
19+
SLACK_COLOR: '#DE512A'
20+
SLACK_ICON: https://github.com/nodejs.png?size=48
21+
SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }}
22+
SLACK_MESSAGE: |
23+
A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.repository }}@${{ github.ref_name }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
24+
25+
Before: <https://github.com/${{ github.repository }}/commit/${{ github.event.before }}|${{ github.event.before }}>
26+
After: <https://github.com/${{ github.repository }}/commit/${{ github.event.after }}|${{ github.event.after }}>
27+
SLACK_USERNAME: nodejs-bot
28+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)