Skip to content

v5.0.0: Native Terraform CLI with Improved PR Comment Output

Compare
Choose a tag to compare
@rdhar rdhar released this 08 Aug 00:36
· 393 commits to main since this release
da990a6

Highlights

Replaced slower "dflook/terraform-*" actions with "hashicorp/setup-terraform", resulting in the workflow finishing 51% faster, saving 37 seconds on average, compared to the previous version. Terraform commands are run in parallel resulting in exponential time gains, compared the previously sequential approach, though your backend will have to handle concurrency.

Added

  • "hashicorp/setup-terraform" action to setup Terraform on the runner, for direct CLI interoperability, instead of slower "dflook/terraform-*" actions.
  • Explicitly populate every single Terraform CLI input option into environment variables for reuse throughout commands.
  • Explicitly pass Terraform environment variables for executing CLI via automation.
  • Custom PR comment script for any and all Terraform stdout/stderr output. Include command trigger and authorship for improved audit trail.
  • CONFIGURE_TF_CHDIR_PREFIX to avoid unnecessarily long and repetitive commands.
  • Upload uniquely-identifiable terraform plan output using "actions/upload-artifact" for download (and unzip) on subsequent terraform apply run (with actions: read permission).
  • Document workflow trigger on pull_request synchronize event for automated terraform plan runs on PR updates.
  • Collapsible sections for definitions in README.
  • [!IMPORTANT], [!NOTE] and [!WARNING] callouts in README.
  • "hashicorp.hcl" extension to .devcontainer.

Changed

  • PR label format from tf:<directory> to terraform:<command>.
  • PR label color from #7B42BC to #5C4EE5 to match GitHub's Terraform label.
  • issue_comment-triggered commit status is applied in "pre" job and updated accordingly (since pull_request-triggered workflow does not need it).
  • Rename "parse" job to "pre".

Removed

  • Concurrency is scrapped, since that should be handled by Terraform's backend.
  • Max-parallel is no longer limited, since Terraform runs in CI/CD are preferred in parallel rather than sequentially.
  • Deployment status is no longer attached to terraform apply.
  • Terraform CLI options documentation, since they are all available now.

Fixed

  • Split-string-on-spaces logic supports both single and double quotation marks.
  • Empty lines within multi-line comments are discarded.

Security

  • Only support v5 onwards.

Commits changelog: v4.1.0...v5.0.0