Skip to content

chore(deps): update actions/checkout action to v4.1.5 #250

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

chore(deps): update actions/checkout action to v4.1.5 #250

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@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
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