docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.41k stars 561 forks source link

Optionally run build checks and fail on issues #1219

Open ferrarimarco opened 3 months ago

ferrarimarco commented 3 months ago

Description

Thanks for working on this action :)

The docker buildx build command exposes the useful check frontend call to check for some best practices.

Would it be possible to optionally run it before running the build, and fail if it returns any warning?

colinhemmings commented 3 months ago

Hi @ferrarimarco Great question. We are working on a dedicated step for validating build configuration to solve this use case.

It is also possible to fail the build by adding a directive, but this will only validate the specified build target. We recommend the step I mentioned above to check the entire build configuration as a validation step for your build.

I can let you know when this new step is available, but would this approach work for you? I am keen to get feedback on how this approach works for people.

ferrarimarco commented 3 months ago

Hi! Thanks for the recommendation. I think that the dedicated step would be best for this use case.

Our current workaround is to manually add a step that runs docker build --check.