abinoda / slack-action

GitHub Action for posting Slack messages
MIT License
270 stars 37 forks source link

It does not throw an error when failed #9

Open jjangga0214 opened 5 years ago

jjangga0214 commented 5 years ago

The example below should not return exit code 0, as SLACK_BOT_TOKEN was invalid. However, it actually doesn't throw an error, which caused github's cogniting the result successful.

https://github.com/jjangga0214/hasura-cli/runs/240981007#step:6:13

Is this intentional as notificatoin is not core part of CI, which you think shouldn't block other important jobs even if there's an error?

aviflax commented 4 years ago

I just ran into a variant of this as well:

Action log excerpt showing an error response from the Slack API ```text ##[group]Run pullreminders/slack-action@v1.0.7 with: args: {"channel": "avi.flax", "icon_emoji": ":pr:", "text": "name: \naction: "} env: SLACK_BOT_TOKEN: *** ##[endgroup] ##[command]/usr/bin/docker run --name bb81953384470c2942e5b0b5110dce426cab_212477 --label 04bb81 --workdir /github/workspace --rm -e SLACK_BOT_TOKEN -e INPUT_ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/docs/docs":"/github/workspace" 04bb81:953384470c2942e5b0b5110dce426cab {"channel": "avi.flax", "icon_emoji": ":pr:", "text": "name: \naction: "} /entrypoint.sh: 4: /entrypoint.sh: [[: not found % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 179 0 116 100 63 1129 613 --:--:-- --:--:-- --:--:-- 1137 {"ok":false,"error":"invalid_json","warning":"missing_charset","response_metadata":{"warnings":["missing_charset"]}} Cleaning up orphan processes ```

To be clear, I don’t need help debugging the reason it’s failing. But I would greatly prefer the action to fail in cases like these.

As long as I’m here: thanks for releasing this action! It’s going to be super helpful for my team.