Skip to content

add slack notif

add slack notif #3

#https://docs.github.com/en/webhooks/webhook-events-and-payloads#push
name: notify-push
on:
push:
branches:
- develop
jobs:
notify:
runs-on: ubuntu-latest
if: github.event.pusher.name == '${{ secrets.COMMIT_PUSH_SOURCE }}'

Check failure on line 10 in .github/workflows/notif-push-to-slack.yml

View workflow run for this annotation

GitHub Actions / notify-push

Invalid workflow file

The workflow is not valid. .github/workflows/notif-push-to-slack.yml (Line: 10, Col: 9): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.COMMIT_PUSH_SOURCE
env:
AUTHOR: ${{ github.event.pusher.name }}
steps:
- name: notify slack
id: slack
uses: slackapi/[email protected]
with:
channel-id: 'develop-direct-pushes'
payload: |
{
"text": " ${{ github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Push: ${{ github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}