From eca2df0909d1429465c63ca9d14d7ae21e8b8194 Mon Sep 17 00:00:00 2001 From: Mary Marchini Date: Wed, 9 Sep 2020 12:10:35 -0700 Subject: [PATCH] meta: notify slack when someone force pushes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notify #nodejs-dev on the OpenJS Foundation slack when someone force-pushes, removing one manual step from force-pushing. PR-URL: https://github.com/nodejs/node/pull/35131 Reviewed-By: Michael Dawson Reviewed-By: Daijiro Wachi Reviewed-By: Trivikram Kamat Reviewed-By: Anna Henningsen Reviewed-By: Juan José Arboleda Reviewed-By: Rich Trott --- .github/workflows/notify-force-push.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/notify-force-push.yml diff --git a/.github/workflows/notify-force-push.yml b/.github/workflows/notify-force-push.yml new file mode 100644 index 00000000000000..079141bba2a8d8 --- /dev/null +++ b/.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 by + + Before: + After: + SLACK_USERNAME: nodejs-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}