Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tools: fix Slack notification action
  • Loading branch information
aduh95 committed Mar 23, 2023
commit de9ed172df1291b7f474de503afebcdfc39ba9e2
13 changes: 8 additions & 5 deletions .github/workflows/notify-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ jobs:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Check commit message
run: npx -q core-validate-commit ${{ github.event.commits[0].id }} || echo "INVALID_COMMIT_MESSAGE=1" >> $GITHUB_ENV
run: npx -q core-validate-commit ${{ github.event.after }} || echo "INVALID_COMMIT_MESSAGE=1" >> $GITHUB_ENV
- name: Retrieve PR number if possible
if: ${{ env.INVALID_COMMIT_MESSAGE }}
run: |
node <<<'EOF'
node <<'EOF' >> $GITHUB_ENV || true
const invalidCommitMessageMatch = /\s\(\#\d+\)$/.exec(process.env.COMMIT_MESSAGE);
if (match == null) process.exit(1)
console.log(`PR_ID=${match[0]}`)
EOF >> $GITHUB_ENV || true
if (invalidCommitMessageMatch == null) process.exit(1)
console.log(`PR_ID=${invalidCommitMessageMatch[0]}`)
EOF
env:
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
- name: Comment on the Pull Request
Expand Down