Skip to content

Commit

Permalink
docs(fix): reference octokit context and github event webhook payload…
Browse files Browse the repository at this point in the history
…s in variables (#348)
  • Loading branch information
zimeg authored Oct 18, 2024
1 parent 2c86117 commit 43604b7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@

Send data into Slack using this GitHub Action!

## Example Workflows

For examples on how to leverage this in your workflows, check out the [example workflows we have](https://github.com/slackapi/slack-github-action/tree/main/example-workflows).

## Sending Variables

You can send GitHub-specific data related to GitHub Action workflow events using [GitHub Contexts](https://docs.github.com/en/actions/learn-github-actions/contexts) and [Variables](https://docs.github.com/en/actions/learn-github-actions/variables) that GitHub Actions provides.
You can provide data to send with this GitHub Action from various sources:

For examples on how to leverage this in your workflows, check out the [example workflows we have](https://github.com/slackapi/slack-github-action/tree/main/example-workflows).
* The default event [context][event-context] with a [payload][event-payload] matching the GitHub event.
* A custom JSON payload with optional [variables][variables] provided in the GitHub Action step.

The custom payload can be provided inline in your GitHub workflow or from a file, [detailed with technique 1](#technique-1-slack-workflow-builder), and will be used instead of the default event context if included.

## How to Send Data to Slack

Expand Down Expand Up @@ -312,7 +319,10 @@ See [CONTRIBUTING](.github/contributing.md).

See [LICENSE](LICENSE).

[apps]: https://api.slack.com/apps
[create-webhook]: https://slack.com/intl/en-ca/help/articles/360041352714-Create-more-advanced-workflows-using-webhooks
[event-context]: https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts#L6
[event-payload]: https://docs.github.com/en/webhooks/webhook-events-and-payloads
[job-step]: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps
[repo-secret]: https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository
[apps]: https://api.slack.com/apps
[variables]: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables

0 comments on commit 43604b7

Please sign in to comment.