slack-action icon indicating copy to clipboard operation
slack-action copied to clipboard

Step won't run if previous step failed

Open leopic opened this issue 5 years ago • 2 comments

This is not related to how this action works, it's more related to how GH Actions work, in general.

I was testing sending a message after running unit tests and was surprised that I never got a slack notification for it, when looking at the debug output I saw this

##[debug]Evaluating: secrets.SLACK_BOT_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'SLACK_BOT_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Notify slack'
##[debug]Parsing expression: <success()>
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> false
##[debug]Result: false

Meaning the step didn't run, because the previous one had failed. I worked around this issue by adding if: always() at the top of the step and it worked just fine.

This got me wondering, should this be stated in the README?

leopic avatar Feb 27 '20 18:02 leopic

@leopic Feel free to submit a PR with the README change!

abinoda avatar Mar 25 '20 21:03 abinoda

Will do, thanks!

On Wed, Mar 25, 2020 at 3:24 PM Abi Noda [email protected] wrote:

@leopic https://github.com/leopic Feel free to submit a PR with the README change!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abinoda/slack-action/issues/15#issuecomment-604095407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA4TQA4UYQM4RQZHUGC7TDRJJY7TANCNFSM4K5AI4YQ .

-- Leo Picado, Software Engineer. leopicado.com

leopic avatar Mar 25 '20 21:03 leopic