hashicorp / setup-packer

Run HashiCorp Packer as part of your GitHub Actions Workflow
https://github.com/marketplace/actions/setup-hashicorp-packer
Apache License 2.0
144 stars 83 forks source link

Exiting GitHub Action on non-zero code #5

Closed benwsapp closed 4 years ago

benwsapp commented 4 years ago

We're running the GitHub Action to essentially lint our packer builds with a packer validate against a wildcard of a bunch of packer config files. If one of the validates fail, it currently does not fail the Action.

Expected Behavior

Running packer validate against multiple config files will fail the Action if one run returns a non-zero code.

Current Behavior

The Action does not fail if a packer validate returns an issue.

Steps to Reproduce

We have our Action run set up like this:

Screen Shot 2020-05-21 at 9 33 36 AM

It runs against a bunch of config files prefixed by "bold-penguin-aws". If one of them fails, it doesn't fail the action.

Environment

Running locally on Mac, Linux, or running in a Linux container in GitHub's environment.

Potential Resolution

Adding set -e to the Entrypoint. When testing locally, that changes the behavior to fit our expectation. But I'm not aware of whether or not that would break other users' scenarios.

ksatirli commented 4 years ago

Hey @benwsapp thanks for the extensive information - this certainly helps!

I'll look into this and see what I can come up with.

ksatirli commented 4 years ago

Running locally on Mac

@benwsapp: I'm wondering if you can share what your local setup for this looks like. I'd love to (reliably) run Actions to test them and so far haven't found a good way.

ksatirli commented 4 years ago

This has been fixed in #4.

Thanks!