From b0b61a2173a430b86abb9073ef8ac4fe97e37c43 Mon Sep 17 00:00:00 2001 From: flakey5 <73616808+flakey5@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:48:37 -0800 Subject: [PATCH] actions: add notify-on-push action Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> --- .github/workflows/notify-on-force-push.yml | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/notify-on-force-push.yml diff --git a/.github/workflows/notify-on-force-push.yml b/.github/workflows/notify-on-force-push.yml new file mode 100644 index 0000000..44a6440 --- /dev/null +++ b/.github/workflows/notify-on-force-push.yml @@ -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 by + Before: + After: + SLACK_USERNAME: nodejs-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}