Inspired by this github action.
This GitHub Action send an event notification to a specific Slack channel whenever a new PR is created or new changes are pushed to the main branch.
event
: Event to notifyjob-status
: Specifies the final job stateslack-bot-token
: Bot token chosen to "write" in the channelchannel
: Channel where the message will be sended
Create a workflow yaml file (for e.g. .github/workflows/slack.yml
).
- name: Slack message Action
uses: ./ # Uses an action in the root directory
id: Slack Action
with:
event: ${{ toJson(github.event) }}
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: pr