hashicorp / setup-packer

Run HashiCorp Packer as part of your GitHub Actions Workflow
https://github.com/marketplace/actions/setup-hashicorp-packer
Apache License 2.0
144 stars 83 forks source link

Better documentation or support for spaces in arguments #19

Closed tokongs closed 1 year ago

tokongs commented 3 years ago

Expected Behavior

The action should be able to parse arguments such as "-var ami_tags={ci-run-id = \"${{ github.run_id }}\"} -except=vagrant.testing". This is something that works when running packer locally, without the github variable of course.

Current Behavior

The action exists with an error and prints the help text for the command.

Steps to Reproduce

Run a workflow with a step like this.

      - name: Build AWS AMI
        uses: hashicorp/packer-github-actions@master
        with:
          command: build
          arguments: "-var ami_tags={ci-run-id = \"${{ github.run_id }}\"} -except=vagrant.testing"
          target: packer.pkr.hcl
        env:
          PACKER_LOG: 1
efernandes-dev-ops commented 3 years ago

@tokongs Could you post the error logs as I think I'm getting the same error, though I am trying to pass a var file

beingamarnath commented 3 years ago

Anyone got around how to resolve environment variables here in the arguments?

JenGoldstrich commented 1 year ago

Hey all, we have re-named this action to setup-packer, the new version of this action installs Packer inside of your GitHub action so that you can just use Packer as you would normally instead of through this interface, it also exposes the ability to just pick the latest version of packer instead of waiting on us to update the sha, this should allow you to use spaces in arguments like you normally do for Packer