Skip to content

v2 potentially breaks using .json as input for tfvars #391

Open
@bjacoby-rn

Description

@bjacoby-rn

Problem description

Hello,

We've been using .json tfvars inputs with your actions and have no issues on any version of v1.

It looks like:

{
  "image_tag": {
    "dev": "bxx34sx-9x1x0"
  }
}

We do this because it's easier for our pipeline to edit json than tfvars.

We tried v2 today and got the following error:

Error: Argument or block definition required

  on zzzz-dflook-terraform-github-actions-00.uat-params.json.auto.tfvars line 1:
   1: {

An argument or block definition is required here.

Not sure if this was explained in the release notes or something, but we don't use the deprecated "var" option.

Terraform version

1.0.5

Backend

s3

Workflow YAML

- name: terraform plan
        id: terraform-plan
        uses: dflook/terraform-plan@v1
        with:
          path: "terraform/${{ inputs.app }}"
          label: "${{ inputs.app }} on ${{ inputs.environment }}"
          add_github_comment: "changes-only"
          var_file: |
            ${{ steps.set-vars.outputs.var-files }}
          backend_config_file: ${{ steps.set-vars.outputs.backend }}
          variables: |
            env = "${{ steps.set-vars.outputs.env }}"
            region = "${{ steps.set-vars.outputs.region }}"

Workflow log

Initializing provider plugins...
  - Reusing previous version of hashicorp/null from the dependency lock file
  - Reusing previous version of hashicorp/aws from the dependency lock file
  - Reusing previous version of hashicorp/local from the dependency lock file
  - Installing hashicorp/null v3.2.2...
  - Installed hashicorp/null v3.2.2 (signed by HashiCorp)
  - Installing hashicorp/aws v5.50.0...
  - Installed hashicorp/aws v5.50.0 (signed by HashiCorp)
  - Installing hashicorp/local v2.5.1...
  - Installed hashicorp/local v2.5.1 (signed by HashiCorp)
  Terraform has made some changes to the provider dependency selections recorded
  in the .terraform.lock.hcl file. Review those changes and commit them to your
  version control system if they represent changes you intended to make.
  
  Terraform has been successfully initialized!

Error: Argument or block definition required

  on zzzz-dflook-terraform-github-actions-00.uat-params.json.auto.tfvars line 1:
   1: {

An argument or block definition is required here.

Has debug logging been enabled?

  • Yes, the ACTIONS_STEP_DEBUG secret was set to true when capturing the workflow log above. I understand that if I have not done this, I may not receive a response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions