Skip to content

Commit 2e5731e

Browse files
authored
tools: validate all commits that are pushed to main
PR-URL: #62246 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 82409af commit 2e5731e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/notify-on-push.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,16 @@ jobs:
3030

3131
validateCommitMessage:
3232
name: Notify on Push on `main` with invalid message
33-
if: github.repository == 'nodejs/node'
3433
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
3534
runs-on: ubuntu-24.04-arm
3635
steps:
37-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38-
with:
39-
persist-credentials: false
40-
- name: Check commit message
36+
- name: Validate commits
37+
run: echo "$COMMITS" | npx -q core-validate-commit -
4138
id: commit-check
42-
run: npx -q core-validate-commit "$COMMIT"
4339
env:
44-
COMMIT: ${{ github.event.after }}
40+
COMMITS: ${{ toJSON(github.event.commits) }}
4541
- name: Slack Notification
46-
if: ${{ failure() && steps.commit-check.conclusion == 'failure' }}
42+
if: ${{ failure() && steps.commit-check.conclusion == 'failure' && github.repository == 'nodejs/node' }}
4743
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
4844
env:
4945
SLACK_COLOR: '#DE512A'

0 commit comments

Comments
 (0)