💡 Summary
Addition of docker_image based hooks for formatting and validating packer configs.
Motivation and context
The current hooks require an installation of packer to work. Those who utilize Docker/Podman can more easily setup and run the hooks without a system install.
This would be useful because it removes the need for a packer installation and adds more cross-platform support.
Implementation notes
An example hook config might look something like this:
- description: |
Runs `packer fmt` on appropriate files inside a Docker.
entry: ghcr.io/cisagov/pre-commit-packer:latest /opt/pre-commit-packer/hooks/packer_fmt.sh
files: \.pkr(?:vars)?\.hcl$
id: packer_fmt_docker
language: docker_image
name: Packer Format (Docker)
It would require a Dockerfile, building an image with GitHub Actions and adding it to GHCR or some other registry.
Acceptance criteria
💡 Summary
Addition of
docker_imagebased hooks for formatting and validatingpackerconfigs.Motivation and context
The current hooks require an installation of
packerto work. Those who utilize Docker/Podman can more easily setup and run the hooks without a system install.This would be useful because it removes the need for a
packerinstallation and adds more cross-platform support.Implementation notes
An example hook config might look something like this:
It would require a
Dockerfile, building an image with GitHub Actions and adding it to GHCR or some other registry.Acceptance criteria
scriptbased hooks continue to work as expected