Skip to content

chore(deps): update actions/checkout action to v4.1.6 #257

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

chore(deps): update actions/checkout action to v4.1.6 #257

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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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