Skip to content

v0.7.0

Compare
Choose a tag to compare
@github-actions github-actions released this 18 Oct 00:49
· 1007 commits to main since this release

Issues | Pull Requests | v0.6.9...v0.7.0 | Base revision

💡 This release includes significant security improvements, so we strongly recommend upgrading to v0.7.0 or later as soon as possible.

Overview

  • Breaking Changes
    • #1175 The setting plan_workflow_name is required in tfaction-root.yaml
    • #1175 terraform-apply action's github_token input, which is the GitHub Actions' token ${{github.token}} by default, requires the additional permission actions: read
  • Features
    • #1175 Change the storage of plan files from S3 or GCS to GitHub Actions' Artifacts
    • #1174 Validate pull request workflow run's commit hash if it is same with the hash of the pull request HEAD

⚠️ Breaking Changes

#1175 The setting plan_workflow_name is required in tfaction-root.yaml.

plan_workflow_name: <GitHub Actions Workflow name running terraform-plan action>

e.g.

plan_workflow_name: test

#1175 terraform-apply action's github_token input, which is the GitHub Actions' token ${{github.token}} by default, requires the additional permission actions: read.

How to upgrade

  • 1. Create a pull request to upgrade tfaction
    • Update tfaction
    • Add the setting plan_workflow_name to tfaction-root.yaml
    • Remove unnecessary settings s3_bucket_name_plan_file and gcs_bucket_name_plan_file from tfaction-root.yaml and tfaction.yaml
    • Add the permission actions: read to terraform-apply action's github_token input, which is the GitHub Actions' token ${{github.token}} by default
      • If you use GitHub App or personal access token, please add the permission actions:read to the token or App
      • 📝 The permission is necessary to download plan files from GitHub Actions Artifacts before running terraform apply: ref
  • 2. Verify the upgrade with a working directory in the upgrade pull request
  • 3. If CI works well, merge the pull request
  • 4. Update all pull request branches to create plan files at GitHub Actions Artifacts

This is an example script to update pull request branches.

#!/usr/bin/env bash

set -euo pipefail

while read -r pr_number; do
	echo "===> Update PR $pr_number" >&2
	gh api -X PUT "repos/{owner}/{repo}/pulls/${pr_number}/update-branch" || :
done < <(gh pr list --json number -L 100 -q ".[].number")

If you merge a pull request without updating the pull request branch, apply would fail because the plan file wouldn't found at GitHub Actions Artifacts. In that case, please merge a follow up pull request, then the issue would be solved.

  • 5. Remove unnecessary resources such as S3 or GCS buckets for plan files and permissions to access plan files

Features

#1175 Change the storage of plan files from S3 or GCS to GitHub Actions' Artifacts
#1174 Validate pull request workflow run's commit hash if it is same with the hash of the pull request HEAD

Change the storage of plan files from S3 or GCS to GitHub Actions' Artifacts

#1175

tfaction ever stored plan files to S3 or GCS, but tfaction v0.7.0 migrats them to GitHub Actions Artifacts.
By this change you don't have to create and manage S3 or GCS.
Furthermore, S3 or GCS had security risks that plan files could be tampered.
GitHub Actions Artifacts can be uploaded files only in the associated workflow run and can't be tampered from outside of the workflow run.

GitHub Actions Artifacts has the retention period so plan files are removed after the retension period.
The default retention period is 90 days, and we think it is enough.

Validate pull request workflow run's commit hash if it is same with the hash of the pull request HEAD

If the workflow run's commit hash is old, the workflow run would fail.
Retrying old workflow run confuses you because old workflow run's results are posted to the pull request as if the latest result.
This validation prevents old workflow run from being retried and resolves the issue.

Thank you for your support ❤️

We really appreciate your support.
We couldn't release v0.7.0 without your support.

We called for testers for this release, then many people helped us!

They conducted tests with the prerelease version. Thank you a lot!

@kyontan
@ponkio-o
@rrreeeyyy

And thank you everyone who reposted my post!