chore(deps): update actions/checkout action to v4.2.2 #301
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
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 |