Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support merging jobs for tfmigrate and terraform #1275

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

suzuki-shunsuke
Copy link
Owner

@suzuki-shunsuke suzuki-shunsuke commented Nov 7, 2023

Close #223

Added new actions plan and apply.
You can replace actions terraform-plan and tfmigrate-plan with plan, and can replace terraform-apply and tfmigrate-apply with apply.
You can merge jobs for tfmigrate with jobs for terraform.
You can simplify workflows.

This pull request keeps the compatibility.

How to merge jobs

  1. Fix outputs of setup job
  2. Remove jobs for tfmigrate
  3. (Optional) Rename jobs terraform-plan and terraform-apply to plan and apply
  4. Fix TFACTION_JOB_TYPE
  5. Replace actions terraform-plan and terraform-apply with plan and apply

1. Fix outputs of setup job

Before

    outputs:
      tfmigrate_targets: ${{ steps.list-targets.outputs.tfmigrate_targets }}
      terraform_targets: ${{ steps.list-targets.outputs.terraform_targets }}
      matrix:
        target: ${{fromJSON(needs.setup.outputs.terraform_targets)}}

After

    outputs:
      targets: ${{ steps.list-targets.outputs.targets }}
      matrix:
        target: ${{fromJSON(needs.setup.outputs.targets)}}

4. Fix TFACTION_JOB_TYPE

Before

TFACTION_JOB_TYPE: terraform

After

TFACTION_JOB_TYPE: ${{matrix.target.job_type}}

5. Replace actions terraform-plan and terraform-apply with plan and apply

You don't need to change inputs.

Before

     - uses: suzuki-shunsuke/tfaction/terraform-plan@v0.7.3
     - uses: suzuki-shunsuke/tfaction/terraform-apply@v0.7.3

After

     - uses: suzuki-shunsuke/tfaction/plan@v0.7.4
     - uses: suzuki-shunsuke/tfaction/apply@v0.7.4

@suzuki-shunsuke suzuki-shunsuke marked this pull request as draft November 7, 2023 08:25
@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Nov 7, 2023
@suzuki-shunsuke suzuki-shunsuke added this to the v0.7.4 milestone Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge jobs for terraform and tfmigrate
1 participant