From 457c62efc0928f6a5b4aad78e3b72c4b42e0baf3 Mon Sep 17 00:00:00 2001 From: "@zimeg" Date: Sat, 26 Oct 2024 00:28:32 -0700 Subject: [PATCH] docs: include a section on inputs for the errors option --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 5b96d73..44f3347 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,28 @@ blocks: Not all of the above settings serve every customization of a workflow, so these options might be useful. +### Exiting with errors + +Invalid API requests or unexpected webhook payloads cause a failing response +that can be used to fail the GitHub Actions step with the `errors` option. + +The `errors` option defaults to `false` so failed requests do not cause the +step to fail. This result can still be gathered from the `ok` output. + +```yaml +- name: Send GitHub Action data to a Slack workflow + uses: slackapi/slack-github-action@v2-development + with: + errors: true + method: chat.reverse + token: ${{ secrets.SLACK_BOT_TOKEN }} + payload: | + text: "palindrome" +``` + +Invalid inputs to the Action, such as not including a payload, will always cause +the GitHub step to fail. + ### Flattening nested payloads Variables and data provided in the payload might contain nested fields that need