Skip to content

Free up even more space #107

Free up even more space

Free up even more space #107

---
# Check that declared Packer images are valid.
name: Validate Packer images
'on':
- push
- pull_request
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: |
sudo apt update -y
# The packer provided by Ubuntu repos is ancient
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install packer
packer plugins install github.com/hashicorp/docker
- name: Validate Packer images
run: |
error=0
for decl in */packer.json; do
pushd "$(dirname "$decl")"
if ! packer validate packer.json; then
echo -n "::error file=$decl,line=1,title=packer validate failed"
echo "::Packer validation failed for $decl."
error=1
fi
popd
done
exit $error