Skip to content

Commit

Permalink
meta: notify slack when someone force pushes
Browse files Browse the repository at this point in the history
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 <midawson@redhat.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
mmarchini authored and targos committed May 1, 2021
1 parent 8bda9f4 commit e0df3bc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/notify-force-push.yml
@@ -0,0 +1,25 @@
on:
push:
branches:
- master

name: Notify on Force Push
jobs:
slackNotification:
name: Slack Notification
if: ${{ github.event.forced && github.repository == 'nodejs/node' }}
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@master
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/master|${{ github.repository }}@master> 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 e0df3bc

Please sign in to comment.