π Fix GitHub event object in push-change-to-discord-webhook-url.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push Change to Discord Webhook URL | |
on: | |
push: | |
branches: | |
- main | |
- 'tmp/receive-commit-to-trigger-GHA' | |
# Allow manual trigger | |
workflow_dispatch: | |
jobs: | |
parse_commit_message: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Parse commit message | |
id: parse_commit_message | |
uses: actions/github-script@v4 | |
with: | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const message = github.event.head_commit.message; | |
const regex = /discord-webhook-url: (.*)/g; | |
const match = regex.exec(message); | |
console.log(match[1]); | |
console.log(`::set-output name=webhook_url::${match[1]}`) |