mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex PR-URL: https://github.com/nodejs/node/pull/66013 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
65 lines
3.0 KiB
YAML
65 lines
3.0 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
name: Notify on Push
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
NODE_VERSION: lts/*
|
|
|
|
jobs:
|
|
notifyOnForcePush:
|
|
name: Notify on Force Push on `main`
|
|
if: github.repository == 'nodejs/node' && github.event.forced
|
|
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Slack Notification
|
|
uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58 # v2.4.0
|
|
env:
|
|
SLACK_COLOR: '#DE512A'
|
|
SLACK_ICON: https://github.com/nodejs.png?size=48
|
|
SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }}
|
|
SLACK_MESSAGE: |
|
|
<!here> 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 }}
|
|
|
|
validateCommitMessage:
|
|
# If a commit is force-pushed out of the main branch, the `commits` array is
|
|
# empty and there are no checks to run.
|
|
if: github.event.commits[0]
|
|
name: Notify on Push on `main` with invalid message
|
|
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Validate commits
|
|
run: echo "$COMMITS" | npx -q core-validate-commit -
|
|
id: commit-check
|
|
env:
|
|
COMMITS: ${{ toJSON(github.event.commits) }}
|
|
- name: Slack Notification
|
|
if: ${{ failure() && steps.commit-check.conclusion == 'failure' && github.repository == 'nodejs/node' }}
|
|
uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58 # v2.4.0
|
|
env:
|
|
SLACK_COLOR: '#DE512A'
|
|
SLACK_ICON: https://github.com/nodejs.png?size=48
|
|
SLACK_TITLE: Invalid commit was pushed to ${{ github.ref }}
|
|
SLACK_MESSAGE: |
|
|
<!here> A commit with an invalid message was 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 }}
|