Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Eden Zimbelman <[email protected]>
Technique 3: Slack incoming webhook
This technique uses this Action to post a message to a channel or direct message with incoming webhooks and a Slack app.
Incoming webhooks follow the same formatting patterns as other Slack messaging APIs. Posted messages can be as short as a single line of text, include additional interactivity with interactive components, or be formatted with Block Kit to build visual components.
Setup
For details on how to setup this technique in GitHub Actions, read the setup section of the docs.
Example workflows
Post an inline text message
Write a line of text after a push event is received.
This example uses incoming webhooks to post a plain text message.
Related files:
text.yml: GitHub Actions workflow.
Post an inline block message
Format a response to recent adventures.
This example uses incoming webhooks to post a message with Block Kit.
Related files:
blocks.yml: GitHub Actions workflow.
Post blocks found in a file
Link to the GitHub Actions job in progress.
This example uses file data when posting to an incoming webhook.
Related files:
saved.data.json: Payload file being sent.saved.gha.yml: GitHub Actions workflow.