Skip to main content

Scaffold working directory by GitHub Actions workflow_dispatch event

When you add a new working directory, you can scaffold the directory by GitHub Actions. tfaction provides a workflow for it.

  1. Prepare template directories to scaffold working directories.


  1. Configure tfaction-root.yaml's target_groups to use the template.


- template_dir: templates/aws
# ...
  1. Set up the workflow


  1. Execute GitHub Actions Workflow manually.


Then a pull request would be created.


Compared with executing commands at the localhost, GitHub Actions has the following merits.

  • GitHub Actions doesn't depend on you local environment
    • You don't have to install tools at local
    • You can avoid the trouble due to the difference of local environment
    • GitHub Actions log is useful for trouble shooting


The following placeholders in templates are replaced.

  • %%TARGET%%: target
  • %%S3_BUCKET_NAME_TFMIGRATE_HISTORY%%: S3 Bucket Name for tfmigrate history files
  • %%GCS_BUCKET_NAME_TFMIGRATE_HISTORY%%: GCS Bucket Name for tfmigrate history files


terraform {
required_version = ">= 1.0"
backend "s3" {
bucket = "S3 Bucket Name"
key = "%%TARGET%%/v1/terraform.tfstate" # Placeholder
region = "us-east-1"

๐Ÿ’ก Skip creating pull requestsโ€‹

If you don't want to create pull requests by GitHub App, please see Support skipping creating pull requests.

๐Ÿ’ก Skip creating aqua.yaml and adding packagesโ€‹

tfaction >= v0.5.25


By default scaffold-working-directory creates aqua.yaml and add some packages.

aqua init
aqua g -i open-policy-agent/conftest terraform-linters/tflint aquasecurity/tfsec hashicorp/terraform

You can skip this.


skip_adding_aqua_packages: true

By skipping this, you can configure packages and their versions in your template or you can also manage them in repository root's aqua.yaml.