Skip to content

chore(deps): update actions/checkout action to v4.2.0 #266

chore(deps): update actions/checkout action to v4.2.0

chore(deps): update actions/checkout action to v4.2.0 #266

name: packer-templates
on:
workflow_dispatch:
push:
branches-ignore:
- main
paths:
- "*.json"
- .github/workflows/packer-templates.yml
permissions: read-all
jobs:
packer-templates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Download Packer
run: |
set -euxo pipefail
PACKER_LATEST_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')
curl -s "https://releases.hashicorp.com/packer/${PACKER_LATEST_VERSION}/packer_${PACKER_LATEST_VERSION}_linux_amd64.zip" --output /tmp/packer_linux_amd64.zip
sudo unzip -o /tmp/packer_linux_amd64.zip -d /usr/local/bin/
packer plugins install github.com/hashicorp/ansible
packer plugins install github.com/hashicorp/qemu
packer plugins install github.com/hashicorp/vagrant
packer plugins install github.com/hashicorp/virtualbox
- name: Validate Packer templates
run: |
IFS=$'\n'
mkdir -pv packer_cache/virtio-win
for FILE in *.json; do
echo "*** ${FILE}"
awk -F\" '/"_comment[0-9]*"/ { gsub("packer build","packer validate",$4); print $4 }' "${FILE}" | while IFS= read -r PACKER_VALIDATE_RUN ; do
echo "* ${PACKER_VALIDATE_RUN}"
eval "${PACKER_VALIDATE_RUN}"
done
done