Skip to content

Commit b696f29

Browse files
authored
actions: add notify-on-push action (#256)
Signed-off-by: flakey5 <[email protected]>
1 parent b77e690 commit b696f29

File tree

1 file changed

+30
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)