Skip to content

Commit

Permalink
actions: add notify-on-push action
Browse files Browse the repository at this point in the history
Signed-off-by: flakey5 <[email protected]>
  • Loading branch information
flakey5 committed Jan 17, 2025
1 parent 87946bf commit b0b61a2
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/notify-on-force-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Notify on Push

on:
push:
branches:
- main

permissions:
contents: read

jobs:
notify-on-push:
name: Notify on Force Push to `main`
if: github.repository == 'nodejs/release-cloudflare-worker' && github.event.forced
runs-on: ubuntu-latest

steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # 2.3.2
env:
SLACK_COLOR: '#DE512A'
SLACK_ICON: https://github.com/nodejs.png?size=48
SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }}
SLACK_MESSAGE: |
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 }}>
Before: <https://github.com/${{ github.repository }}/commit/${{ github.event.before }}|${{ github.event.before }}>
After: <https://github.com/${{ github.repository }}/commit/${{ github.event.after }}|${{ github.event.after }}>
SLACK_USERNAME: nodejs-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit b0b61a2

Please sign in to comment.