Without pinning Node.js, the runner defaults to Node 20 and npx falls back to core-validate-commit@5.0.1 instead of 6.0.0 (requires Node 22+). Version 5 does not recognise the ffi subsystem, causing false invalid-commit alerts. Signed-off-by: Nenad Spasenic <40522817+nsinfoPRO@users.noreply.github.com> PR-URL: https://github.com/nodejs/node/pull/63084 Fixes: https://github.com/nodejs/node/issues/63070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
61 lines
2.8 KiB
YAML
61 lines
2.8 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@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
|
|
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:
|
|
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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
|
|
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 }}
|