From dec11731359bfb2dc22a7395ed2a23a13ef4c28c Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 10 Jul 2024 21:28:06 +0000 Subject: [PATCH] Add packer validate github check workflow Signed-off-by: Peter Zhu --- .github/workflows/packer.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/packer.yml diff --git a/.github/workflows/packer.yml b/.github/workflows/packer.yml new file mode 100644 index 0000000..d1a9e6b --- /dev/null +++ b/.github/workflows/packer.yml @@ -0,0 +1,31 @@ +name: packer validate + +on: + pull_request: + paths: + - packer/** + +env: + PACKER_VERSION: "1.8.7" + +jobs: + packer-validate: + runs-on: ubuntu-latest + name: Run Packer + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup `packer` + uses: hashicorp/setup-packer@main + id: setup + with: + version: ${{ env.PACKER_VERSION }} + + - name: Run `packer validate` + id: validate + run: | + cd packer/ + for template in `find . -name "*.json"`; do + packer validate $template + done