tfaction

Framework for Monorepo to build high level Terraform Workflows by GitHub Actions

MIT License

Stars
237

Bot releases are hidden (Show)

tfaction - v0.5.3

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.5.2...v0.5.3 | Base revision

Bug Fixes

The bug affects v0.5.2

When we release v0.5.2 with the release script, local changes were committed accidentally.
https://github.com/suzuki-shunsuke/tfaction/commit/25a5bbe9412f5c422d236c732541a45cc206e07a

tfaction - v0.5.2

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.5.1...v0.5.2 | Base revision

⚠️ This release includes a critical bug. Please update

https://github.com/suzuki-shunsuke/tfaction/releases/tag/v0.5.3

When we release v0.5.2 with the release script, local changes were committed accidentally.
https://github.com/suzuki-shunsuke/tfaction/commit/25a5bbe9412f5c422d236c732541a45cc206e07a

Bug Fixes

#251 terraform-plan, terraform-apply: Set -no-color to allow tfcmt to parse terraform's error and warning properly

tfaction - v0.5.1

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.5.0...v0.5.1 | Base revision

Bug Fixes

#247 scaffold-tfmigrate: Create a tfmigrate:* label properly

tfaction - v0.5.0

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.12...v0.5.0 | Base revision

⚠️ Breaking Changes

#183 #204 ignore labels are replaced to skip labels
https://suzuki-shunsuke.github.io/tfaction/docs/feature/tfmigrate#multi_state-migration

When you use tfmigrate across multiple Terraform States, please use skip:* label instead of ignore:* label.

ignore:* label was abolished.
If skip* label is set, terraform plan and terraform apply are skipped but other steps such as test are run.

The configuration label_prefixes.ignore in tfaction-root.yaml is replaced to label_prefixes.skip.

Features

#202 #207 Support skipping to create pull requests
#221 #222 Support managing Terraform Modules
#214 Decrease the number of GitHub API call by storing ci-info's result as artifacts

Support skipping to create pull requests

#202 #207 https://suzuki-shunsuke.github.io/tfaction/docs/feature/skip-creating-pr

tfaction supports creating some types of pull requests.

  • Follow up Pull Request
  • Scaffold working directory Pull Request
  • Scaffold tfmigrate migration Pull Request

They are really useful, but these pull requests are created by GitHub App so you can pass 1 approval Required by approving your changes by yourself. To solve the problem, tfaction provides the setting skip_create_pr in tfaction-root.yaml.

skip_create_pr: true # By default, this is false

If this is true, tfaction creates a feature branch and guides how to create a pull request but doesn't create a pull request.
Please see the tfaction's message and create a pull request by gh pr create command.

Support managing Terraform Modules

#221 #222 https://suzuki-shunsuke.github.io/tfaction/docs/feature/module

tfaction supports scaffolding, testing, and releasing Terraform Modules.
Furthermore, tfaction supports generating the Module document with terraform-docs automatically.

Three actions have been added.

How to manage Terraform Modules

⚠️ terraform-docs is required.

Please add terraform-docs/terraform-docs to aqua.yaml.

$ aqua g -i terraform-docs/terraform-docs
Update test workflow

Example

Add the output modules.

jobs:
  setup:
    runs-on: ubuntu-latest
    outputs:
      tfmigrate_targets: ${{ steps.list-targets.outputs.tfmigrate_targets }}
      terraform_targets: ${{ steps.list-targets.outputs.terraform_targets }}
      modules: ${{ steps.list-targets.outputs.modules }} # Add

Add the job test-module.

  test-module:
    name: "test-module (${{matrix.target}})"
    runs-on: ubuntu-latest
    needs: setup
    # if services is empty, the build job is skipped
    if: "join(fromJSON(needs.setup.outputs.modules), '') != ''"
    env:
      TFACTION_TARGET: ${{matrix.target}}
    strategy:
      fail-fast: true
      matrix:
        target: ${{fromJSON(needs.setup.outputs.modules)}}
    steps:
      - uses: actions/checkout@v2
      - name: Generate token
        id: generate_token
        uses: tibdex/github-app-token@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}

      - uses: aquaproj/[email protected]
        with:
          aqua_version: v1.1.0
          aqua_opts: -l -a
          working_directory: ${{ matrix.target }}

      - uses: suzuki-shunsuke/tfaction/[email protected]
        with:
          github_app_token: ${{ steps.generate_token.outputs.token }}
Add workflows release-module and scaffold-module
tfaction - v0.5.0-6

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.5.0-5...v0.5.0-6 | Base revision

Bug Fixes

#240 (create-follow-up-pr): create a label properly

tfaction - v0.5.0-5

Published by suzuki-shunsuke over 2 years ago

tfaction - v0.5.0-4

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.5.0-3...v0.5.0-4 | Base revision

Bug Fixes

#238 (test-module): Remove .terraform.lock.hcl before running terraform-docs

tfaction - v0.5.0-3

Published by suzuki-shunsuke over 2 years ago

tfaction - v0.5.0-2

Published by suzuki-shunsuke over 2 years ago

tfaction - v0.5.0-1

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.5.0-0...v0.5.0-1 | Base revision

Feautre

#221 #222 Support managing Terraform Modules

Three actions have been added.

  • scaffold-module
  • release-module
  • test-module
tfaction - v0.5.0-0

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.12...v0.5.0 | Base revision

⚠️ Breaking Changes

#183 #204 ignore labels are replaced to skip labels

When you use tfmigrate across multiple Terraform States, please use skip:* label instead of ignore:* label.
ignore:* label was abolished.
If skip* label is set, terraform plan and terraform apply are skipped but other steps such as test are run.

The configuration label_prefixes.ignore in tfaction-root.yaml is replaced to label_prefixes.skip.

Features

#202 #207 Support skipping to create pull requests
#214 Decrease the number of GitHub API call by storing ci-info's result as artifacts

Support skipping to create pull requests

#202 #207

tfaction supports creating some types of pull requests.

  • Follow up Pull Request
  • Scaffold working directory Pull Request
  • Scaffold tfmigrate migration Pull Request

They are really useful, but these pull requests are created by GitHub App so you can pass 1 approval Required by approving your changes by yourself. To solve the problem, tfaction provides the setting skip_create_pr in tfaction-root.yaml.

skip_create_pr: true # By default, this is false

If this is true, tfaction creates a feature branch and guides how to create a pull request but doesn't create a pull request.
Please see the tfaction's message and create a pull request by gh pr create command.

tfaction - v0.4.11

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.10...v0.4.11 | Base revision

Features

#179 #180 Add mention to Follow up Pull Request Body

e.g.

#185 create-scaffold-pr: Add mention to GITHUB_ACTOR

#184 #187 #188 Add a workflow for tfmigrate

---
name: scaffold tfmigrate
on:
  workflow_dispatch:
    inputs:
      target:
        description: 'target'
        required: true
      migration_name:
        description: 'migration name. e.g. "import_foo"'
        required: true
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  TFACTION_TARGET: ${{github.event.inputs.target}}
permissions:
  contents: read
  pull-requests: write
jobs:
  scaffold:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: aquaproj/[email protected]
        with:
          aqua_version: v0.10.2

      - name: Generate token
        id: generate_token
        uses: tibdex/github-app-token@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}

      - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@main
        id: scaffold-working-dir
        with:
          github_app_token: ${{ steps.generate_token.outputs.token }}
          migration_name: ${{github.event.inputs.migration_name}}
tfaction - v0.4.11-2

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.11-1...v0.4.11-2 | Base revision

Bug Fixes

#188 Fix scaffold .tfmigrate.hcl. Follow up #187

tfaction - v0.4.11-1

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.11-0...v0.4.11-1 | Base revision

Features

#185 create-scaffold-pr: Add mention to GITHUB_ACTOR

#184 #187 Add a workflow for tfmigrate

---
name: scaffold tfmigrate
on:
  workflow_dispatch:
    inputs:
      target:
        description: 'target'
        required: true
      migration_name:
        description: 'migration name. e.g. "import_foo"'
        required: true
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  TFACTION_TARGET: ${{github.event.inputs.target}}
permissions:
  contents: read
  pull-requests: write
jobs:
  scaffold:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: aquaproj/[email protected]
        with:
          aqua_version: v0.10.2

      - name: Generate token
        id: generate_token
        uses: tibdex/github-app-token@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}

      - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@main
        id: scaffold-working-dir
        with:
          github_app_token: ${{ steps.generate_token.outputs.token }}
          migration_name: ${{github.event.inputs.migration_name}}
tfaction - v0.4.11-0

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.10...v0.4.11-0 | Base revision

Features

#179 #180 Add mention to Follow up Pull Request Body

e.g.

tfaction - v0.4.10

Published by suzuki-shunsuke over 2 years ago

Issues | Pull Requests | https://github.com/suzuki-shunsuke/tfaction/compare/v0.4.9...v0.4.10 | Base revision

Features

#171 Update tflint action to notify with github-comment
#172 Update tfsec action to notify with github-comment

Bug Fixes

#176 Remove template_dir from tfaction.yaml. template_dir is used in tfaction-root.yaml

tfaction - v0.4.10-1

Published by suzuki-shunsuke over 2 years ago

Package Rankings
Top 6.73% on Proxy.golang.org