From 434e99c79d44b3f998647949810097e0711f9d9f Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 26 Nov 2023 19:13:46 +0900 Subject: [PATCH 1/5] chore: update tfaction to pr/1291 - https://github.com/suzuki-shunsuke/tfaction/pull/1291 --- .github/workflows/apply.yaml | 12 ++++++------ .github/workflows/release-module.yaml | 2 +- .github/workflows/scaffold-module.yaml | 2 +- .github/workflows/scaffold-tfmigrate.yaml | 2 +- .github/workflows/scaffold-working-directory.yaml | 4 ++-- .github/workflows/schedule-detect-drifts.yaml | 10 +++++----- .github/workflows/sync-drift-issue-description.yaml | 2 +- .github/workflows/wc-plan.yaml | 10 +++++----- .github/workflows/wc-setup.yaml | 2 +- .github/workflows/wc-test-module.yaml | 2 +- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/apply.yaml b/.github/workflows/apply.yaml index aadb80f41..b1871cccc 100644 --- a/.github/workflows/apply.yaml +++ b/.github/workflows/apply.yaml @@ -19,7 +19,7 @@ jobs: with: aqua_version: v2.21.0 - - uses: suzuki-shunsuke/tfaction/list-targets@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/list-targets@pr/1291 id: list-targets apply: @@ -60,7 +60,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{ steps.aqua_installer_token.outputs.token }} - - uses: suzuki-shunsuke/tfaction/export-secrets@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/export-secrets@pr/1291 with: secrets: ${{ toJSON(secrets) }} @@ -126,7 +126,7 @@ jobs: "test-tfaction-drift-issues" ] - - uses: suzuki-shunsuke/tfaction/setup@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/setup@pr/1291 with: github_app_token: ${{ steps.setup_token.outputs.token }} ssh_key: ${{ secrets.TERRAFORM_PRIVATE_MODULE_SSH_KEY }} # This isn't needed if you don't use SSH key to checkout private Terraform Modules @@ -152,7 +152,7 @@ jobs: "test-tfaction-drift-issues" ] - - uses: suzuki-shunsuke/tfaction/apply@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/apply@pr/1291 with: github_app_token: ${{ steps.apply_token.outputs.token }} @@ -175,12 +175,12 @@ jobs: "${{github.event.repository.name}}" ] - - uses: suzuki-shunsuke/tfaction/create-follow-up-pr@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/create-follow-up-pr@pr/1291 if: failure() with: github_app_token: ${{steps.follow_up_pr_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/update-drift-issue@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/update-drift-issue@pr/1291 if: always() with: status: ${{job.status}} diff --git a/.github/workflows/release-module.yaml b/.github/workflows/release-module.yaml index 0d11c5557..50e0bdcdc 100644 --- a/.github/workflows/release-module.yaml +++ b/.github/workflows/release-module.yaml @@ -24,7 +24,7 @@ jobs: with: aqua_version: v2.21.0 - - uses: suzuki-shunsuke/tfaction/release-module@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/release-module@pr/1291 with: version: ${{ github.event.inputs.version }} module_path: ${{ github.event.inputs.module_path }} diff --git a/.github/workflows/scaffold-module.yaml b/.github/workflows/scaffold-module.yaml index 9cfb1ab48..ed8f2b22d 100644 --- a/.github/workflows/scaffold-module.yaml +++ b/.github/workflows/scaffold-module.yaml @@ -36,7 +36,7 @@ jobs: repositories: >- ["${{github.event.repository.name}}"] - - uses: suzuki-shunsuke/tfaction/scaffold-module@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/scaffold-module@pr/1291 with: github_token: ${{ steps.generate_token.outputs.token }} module_path: ${{ github.event.inputs.module_path }} diff --git a/.github/workflows/scaffold-tfmigrate.yaml b/.github/workflows/scaffold-tfmigrate.yaml index 05c7341e7..1386260f7 100644 --- a/.github/workflows/scaffold-tfmigrate.yaml +++ b/.github/workflows/scaffold-tfmigrate.yaml @@ -45,7 +45,7 @@ jobs: env: GITHUB_TOKEN: ${{github.token}} - - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@pr/1291 with: github_app_token: ${{steps.generate_token.outputs.token}} migration_name: ${{github.event.inputs.migration_name}} diff --git a/.github/workflows/scaffold-working-directory.yaml b/.github/workflows/scaffold-working-directory.yaml index 653bcca46..774999e44 100644 --- a/.github/workflows/scaffold-working-directory.yaml +++ b/.github/workflows/scaffold-working-directory.yaml @@ -20,7 +20,7 @@ jobs: with: aqua_version: v2.21.0 - - uses: suzuki-shunsuke/tfaction/scaffold-working-dir@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/scaffold-working-dir@pr/1291 - name: Generate token id: generate_token @@ -38,6 +38,6 @@ jobs: repositories: >- ["${{github.event.repository.name}}"] - - uses: suzuki-shunsuke/tfaction/create-scaffold-pr@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/create-scaffold-pr@pr/1291 with: github_app_token: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/schedule-detect-drifts.yaml b/.github/workflows/schedule-detect-drifts.yaml index 4cf9bc9e2..2288f097b 100644 --- a/.github/workflows/schedule-detect-drifts.yaml +++ b/.github/workflows/schedule-detect-drifts.yaml @@ -82,32 +82,32 @@ jobs: env: GITHUB_TOKEN: ${{github.token}} - - uses: suzuki-shunsuke/tfaction/set-drift-env@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/set-drift-env@pr/1291 with: issue: ${{toJSON(matrix.issue)}} - - uses: suzuki-shunsuke/tfaction/setup@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/setup@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} github_app_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/test@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/test@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} github_app_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/terraform-plan@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/terraform-plan@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} github_app_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/update-drift-issue@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/update-drift-issue@pr/1291 if: always() with: status: ${{job.status}} diff --git a/.github/workflows/sync-drift-issue-description.yaml b/.github/workflows/sync-drift-issue-description.yaml index bff970a57..dbd6a1eda 100644 --- a/.github/workflows/sync-drift-issue-description.yaml +++ b/.github/workflows/sync-drift-issue-description.yaml @@ -14,4 +14,4 @@ jobs: permissions: issues: write steps: - - uses: suzuki-shunsuke/tfaction/sync-drift-issue-description@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/sync-drift-issue-description@pr/1291 diff --git a/.github/workflows/wc-plan.yaml b/.github/workflows/wc-plan.yaml index 4b8bf0dd9..64ce2e1c1 100644 --- a/.github/workflows/wc-plan.yaml +++ b/.github/workflows/wc-plan.yaml @@ -53,7 +53,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{steps.aqua_installer_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/export-secrets@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/export-secrets@pr/1291 with: secrets: ${{toJSON(secrets)}} @@ -95,13 +95,13 @@ jobs: repositories: >- ["${{github.event.repository.name}}"] - - uses: suzuki-shunsuke/tfaction/setup@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/setup@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # For GitHub Provider - - uses: suzuki-shunsuke/tfaction/get-target-config@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/get-target-config@pr/1291 id: target-config - name: Generate token (pull request write) @@ -131,13 +131,13 @@ jobs: - name: registry.terraform.io/integrations/github GITHUB_TOKEN: ${{steps.pull_request_token.outputs.token}} # For github-comment - - uses: suzuki-shunsuke/tfaction/test@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/test@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # For GitHub Provider and reviewdog and github-comment - - uses: suzuki-shunsuke/tfaction/plan@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/plan@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} env: diff --git a/.github/workflows/wc-setup.yaml b/.github/workflows/wc-setup.yaml index db38d149f..81a6a8dbc 100644 --- a/.github/workflows/wc-setup.yaml +++ b/.github/workflows/wc-setup.yaml @@ -54,7 +54,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/list-targets@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/list-targets@pr/1291 id: list-targets env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} diff --git a/.github/workflows/wc-test-module.yaml b/.github/workflows/wc-test-module.yaml index 67ec106e6..d2e2f60e7 100644 --- a/.github/workflows/wc-test-module.yaml +++ b/.github/workflows/wc-test-module.yaml @@ -55,7 +55,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{github.token}} - - uses: suzuki-shunsuke/tfaction/test-module@5731fade20e41c1905c04095f0e3d68fac14a636 # v0.7.3 + - uses: suzuki-shunsuke/tfaction/test-module@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} env: From 08663ed9e89fcbf3e331f3197b0698520c4c090a Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 26 Nov 2023 19:14:59 +0900 Subject: [PATCH 2/5] chore: add a template of Terraform Module --- templates/module-hello/.terraform-docs.yml | 4 ++ templates/module-hello/.tflint.hcl | 40 ++++++++++++++ .../module-hello/aqua/aqua-checksums.json | 54 +++++++++++++++++++ templates/module-hello/aqua/aqua.yaml | 13 +++++ .../module-hello/aqua/imports/tflint.yaml | 2 + .../module-hello/aqua/imports/trivy.yaml | 2 + templates/module-hello/docs/footer.md | 4 ++ templates/module-hello/docs/header.md | 11 ++++ templates/module-hello/locals.tf | 3 ++ templates/module-hello/main.tf | 3 ++ templates/module-hello/outputs.tf | 4 ++ templates/module-hello/variables.tf | 5 ++ templates/module-hello/versions.tf | 9 ++++ 13 files changed, 154 insertions(+) create mode 100644 templates/module-hello/.terraform-docs.yml create mode 100644 templates/module-hello/.tflint.hcl create mode 100644 templates/module-hello/aqua/aqua-checksums.json create mode 100644 templates/module-hello/aqua/aqua.yaml create mode 100644 templates/module-hello/aqua/imports/tflint.yaml create mode 100644 templates/module-hello/aqua/imports/trivy.yaml create mode 100644 templates/module-hello/docs/footer.md create mode 100644 templates/module-hello/docs/header.md create mode 100644 templates/module-hello/locals.tf create mode 100644 templates/module-hello/main.tf create mode 100644 templates/module-hello/outputs.tf create mode 100644 templates/module-hello/variables.tf create mode 100644 templates/module-hello/versions.tf diff --git a/templates/module-hello/.terraform-docs.yml b/templates/module-hello/.terraform-docs.yml new file mode 100644 index 000000000..6ca650516 --- /dev/null +++ b/templates/module-hello/.terraform-docs.yml @@ -0,0 +1,4 @@ +# https://terraform-docs.io/ +formatter: markdown +header-from: docs/header.md +footer-from: docs/footer.md diff --git a/templates/module-hello/.tflint.hcl b/templates/module-hello/.tflint.hcl new file mode 100644 index 000000000..117063739 --- /dev/null +++ b/templates/module-hello/.tflint.hcl @@ -0,0 +1,40 @@ +# https://github.com/terraform-linters/tflint/tree/master/docs/rules +rule "terraform_deprecated_index" { + enabled = true +} + +rule "terraform_unused_declarations" { + enabled = true +} + +rule "terraform_comment_syntax" { + enabled = true +} + +rule "terraform_documented_outputs" { + enabled = true +} + +rule "terraform_documented_variables" { + enabled = true +} + +rule "terraform_typed_variables" { + enabled = true +} + +rule "terraform_naming_convention" { + enabled = true +} + +rule "terraform_required_version" { + enabled = true +} + +rule "terraform_required_providers" { + enabled = true +} + +rule "terraform_standard_module_structure" { + enabled = true +} diff --git a/templates/module-hello/aqua/aqua-checksums.json b/templates/module-hello/aqua/aqua-checksums.json new file mode 100644 index 000000000..5f0261e16 --- /dev/null +++ b/templates/module-hello/aqua/aqua-checksums.json @@ -0,0 +1,54 @@ +{ + "checksums": [ + { + "id": "github_release/github.com/aquasecurity/trivy/v0.46.0/trivy_0.46.0_Linux-64bit.tar.gz", + "checksum": "D26B6A5B4445C4A7F99E104A8C47579AEC150023FB927D55F8622E760C171AF2", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/aquasecurity/trivy/v0.46.0/trivy_0.46.0_Linux-ARM64.tar.gz", + "checksum": "6AF0383E99B579203BBA3286C780BEBFC49A1EFB66739BC6FEFA3B0A779499B4", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/aquasecurity/trivy/v0.46.0/trivy_0.46.0_macOS-64bit.tar.gz", + "checksum": "C2E498941FE8914C3B364AE982ABB1DEA362AF0DEF7E6F15175166B3CFFF5947", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/aquasecurity/trivy/v0.46.0/trivy_0.46.0_macOS-ARM64.tar.gz", + "checksum": "B5A8F853A132B18BFF6ABA3E20604F81DE724DEFCCD188B53FFF1ED55BE00918", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/terraform-linters/tflint/v0.48.0/tflint_darwin_amd64.zip", + "checksum": "8F491F42A07152B27D7C3599FAF24EB839A202F5C58EF735740303AE3CAD51FA", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/terraform-linters/tflint/v0.48.0/tflint_darwin_arm64.zip", + "checksum": "88BBA0BD1CA4012F836D14093E5D18CF0D6633C7FEA82404382FDA70C99753A0", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/terraform-linters/tflint/v0.48.0/tflint_linux_amd64.zip", + "checksum": "13C7947963C4DC4F0AA9E0CB7A0854367A425162A508BC7517D1CBCBEF822F3C", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/terraform-linters/tflint/v0.48.0/tflint_linux_arm64.zip", + "checksum": "EF4E07EF95E5F2779DF0ED43E62364855DAFB92B938CF62F08C64016DE2756B0", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/terraform-linters/tflint/v0.48.0/tflint_windows_amd64.zip", + "checksum": "1EFAB7EA19E8ADB73CAE770E5EDABAE44A5CEBD63BAF203A5D3270948DB55648", + "algorithm": "sha256" + }, + { + "id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.71.0/registry.yaml", + "checksum": "A1C0A6710A70FA6C8CA737392B1E4455B9D25C42650631F8713B7E45680B74456892B4EA2EB71AAF4EB272DC5B0B73C226A54E60BA4561B12D0FFE47A5DDC78A", + "algorithm": "sha512" + } + ] +} diff --git a/templates/module-hello/aqua/aqua.yaml b/templates/module-hello/aqua/aqua.yaml new file mode 100644 index 000000000..f3dd51f0b --- /dev/null +++ b/templates/module-hello/aqua/aqua.yaml @@ -0,0 +1,13 @@ +--- +# aqua - Declarative CLI Version Manager +# https://aquaproj.github.io/ +checksum: + enabled: true + require_checksum: true +# supported_envs: +# - all +registries: +- type: standard + ref: v4.71.0 # renovate: depName=aquaproj/aqua-registry +packages: + - import: imports/*.yaml diff --git a/templates/module-hello/aqua/imports/tflint.yaml b/templates/module-hello/aqua/imports/tflint.yaml new file mode 100644 index 000000000..e55003d66 --- /dev/null +++ b/templates/module-hello/aqua/imports/tflint.yaml @@ -0,0 +1,2 @@ +packages: + - name: terraform-linters/tflint@v0.48.0 diff --git a/templates/module-hello/aqua/imports/trivy.yaml b/templates/module-hello/aqua/imports/trivy.yaml new file mode 100644 index 000000000..23c58a5e7 --- /dev/null +++ b/templates/module-hello/aqua/imports/trivy.yaml @@ -0,0 +1,2 @@ +packages: + - name: aquasecurity/trivy@v0.46.0 diff --git a/templates/module-hello/docs/footer.md b/templates/module-hello/docs/footer.md new file mode 100644 index 000000000..4c7599b88 --- /dev/null +++ b/templates/module-hello/docs/footer.md @@ -0,0 +1,4 @@ + +--- + +This document is generated by [terraform-docs](https://terraform-docs.io/) diff --git a/templates/module-hello/docs/header.md b/templates/module-hello/docs/header.md new file mode 100644 index 000000000..7f78db05d --- /dev/null +++ b/templates/module-hello/docs/header.md @@ -0,0 +1,11 @@ +# %%MODULE_NAME%% + +[Versions](https://github.com/%%GITHUB_REPOSITORY%%/releases?q=%%MODULE_PATH%%) + +## Example + +```tf +module "foo" { + source = "github.com/%%GITHUB_REPOSITORY%%//%%MODULE_PATH%%?ref=%%REF%%" +} +``` diff --git a/templates/module-hello/locals.tf b/templates/module-hello/locals.tf new file mode 100644 index 000000000..894a2503b --- /dev/null +++ b/templates/module-hello/locals.tf @@ -0,0 +1,3 @@ +locals { + foo = 1 +} diff --git a/templates/module-hello/main.tf b/templates/module-hello/main.tf new file mode 100644 index 000000000..02bbaec30 --- /dev/null +++ b/templates/module-hello/main.tf @@ -0,0 +1,3 @@ +resource "null_resource" "foo" { + count = max(local.foo, var.hello) +} diff --git a/templates/module-hello/outputs.tf b/templates/module-hello/outputs.tf new file mode 100644 index 000000000..369c4230b --- /dev/null +++ b/templates/module-hello/outputs.tf @@ -0,0 +1,4 @@ +output "hello" { + description = "hello" + value = "hello" +} diff --git a/templates/module-hello/variables.tf b/templates/module-hello/variables.tf new file mode 100644 index 000000000..e3ee9653d --- /dev/null +++ b/templates/module-hello/variables.tf @@ -0,0 +1,5 @@ +variable "hello" { + description = "hello" + type = number + default = 1 +} diff --git a/templates/module-hello/versions.tf b/templates/module-hello/versions.tf new file mode 100644 index 000000000..722cbb4b6 --- /dev/null +++ b/templates/module-hello/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + required_providers { + null = { + source = "hashicorp/null" + version = "3.2.2" + } + } +} From 6f28d71b3cb5f4a8ebdbe465d9cca81a15cef1a3 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 26 Nov 2023 19:16:27 +0900 Subject: [PATCH 3/5] fix: replace github_app_token to github_token --- .github/workflows/apply.yaml | 6 +++--- .github/workflows/scaffold-tfmigrate.yaml | 2 +- .github/workflows/scaffold-working-directory.yaml | 2 +- .github/workflows/schedule-detect-drifts.yaml | 3 --- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/apply.yaml b/.github/workflows/apply.yaml index b1871cccc..18ccd8795 100644 --- a/.github/workflows/apply.yaml +++ b/.github/workflows/apply.yaml @@ -128,7 +128,7 @@ jobs: - uses: suzuki-shunsuke/tfaction/setup@pr/1291 with: - github_app_token: ${{ steps.setup_token.outputs.token }} + github_token: ${{ steps.setup_token.outputs.token }} ssh_key: ${{ secrets.TERRAFORM_PRIVATE_MODULE_SSH_KEY }} # This isn't needed if you don't use SSH key to checkout private Terraform Modules - name: Generate token for apply @@ -154,7 +154,7 @@ jobs: - uses: suzuki-shunsuke/tfaction/apply@pr/1291 with: - github_app_token: ${{ steps.apply_token.outputs.token }} + github_token: ${{ steps.apply_token.outputs.token }} - name: Generate token for creating follow up pr id: follow_up_pr_token @@ -178,7 +178,7 @@ jobs: - uses: suzuki-shunsuke/tfaction/create-follow-up-pr@pr/1291 if: failure() with: - github_app_token: ${{steps.follow_up_pr_token.outputs.token}} + github_token: ${{steps.follow_up_pr_token.outputs.token}} - uses: suzuki-shunsuke/tfaction/update-drift-issue@pr/1291 if: always() diff --git a/.github/workflows/scaffold-tfmigrate.yaml b/.github/workflows/scaffold-tfmigrate.yaml index 1386260f7..4bfe31576 100644 --- a/.github/workflows/scaffold-tfmigrate.yaml +++ b/.github/workflows/scaffold-tfmigrate.yaml @@ -47,6 +47,6 @@ jobs: - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@pr/1291 with: - github_app_token: ${{steps.generate_token.outputs.token}} + github_token: ${{steps.generate_token.outputs.token}} migration_name: ${{github.event.inputs.migration_name}} pr_number: ${{inputs.pr_number}} diff --git a/.github/workflows/scaffold-working-directory.yaml b/.github/workflows/scaffold-working-directory.yaml index 774999e44..997a0ecb9 100644 --- a/.github/workflows/scaffold-working-directory.yaml +++ b/.github/workflows/scaffold-working-directory.yaml @@ -40,4 +40,4 @@ jobs: - uses: suzuki-shunsuke/tfaction/create-scaffold-pr@pr/1291 with: - github_app_token: ${{ steps.generate_token.outputs.token }} + github_token: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/schedule-detect-drifts.yaml b/.github/workflows/schedule-detect-drifts.yaml index 2288f097b..070259973 100644 --- a/.github/workflows/schedule-detect-drifts.yaml +++ b/.github/workflows/schedule-detect-drifts.yaml @@ -89,21 +89,18 @@ jobs: - uses: suzuki-shunsuke/tfaction/setup@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} - github_app_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - uses: suzuki-shunsuke/tfaction/test@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} - github_app_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - uses: suzuki-shunsuke/tfaction/terraform-plan@pr/1291 with: github_token: ${{steps.generate_token.outputs.token}} - github_app_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} From b075bddbc5efb351c4aec429b2ec60cea8de3e34 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 26 Nov 2023 19:17:56 +0900 Subject: [PATCH 4/5] fix: fix scaffold-module --- .github/workflows/scaffold-module.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scaffold-module.yaml b/.github/workflows/scaffold-module.yaml index ed8f2b22d..d1d951e68 100644 --- a/.github/workflows/scaffold-module.yaml +++ b/.github/workflows/scaffold-module.yaml @@ -7,9 +7,17 @@ on: module_path: description: 'module path' required: true + template_dir: + type: choice + default: templates/module-hello + options: + - templates/module-hello jobs: scaffold: runs-on: ubuntu-latest + env: + TFACTION_MODULE_PATH: ${{inputs.module_path}} + TFACTION_MODULE_TEMPLATE_DIR: ${{inputs.template_dir}} permissions: contents: read steps: @@ -38,5 +46,8 @@ jobs: - uses: suzuki-shunsuke/tfaction/scaffold-module@pr/1291 with: - github_token: ${{ steps.generate_token.outputs.token }} - module_path: ${{ github.event.inputs.module_path }} + github_token: ${{steps.generate_token.outputs.token}} + + - uses: suzuki-shunsuke/tfaction/create-scaffold-module-pr@pr/1291 + with: + github_token: ${{steps.generate_token.outputs.token}} From b8851f338a2e3206aa547ce295895efe6e2b3540 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Mon, 27 Nov 2023 09:53:29 +0900 Subject: [PATCH 5/5] chore: pin tfaction to v1.0.0-1 --- .github/workflows/apply.yaml | 12 ++++++------ .github/workflows/release-module.yaml | 2 +- .github/workflows/scaffold-module.yaml | 4 ++-- .github/workflows/scaffold-tfmigrate.yaml | 2 +- .github/workflows/scaffold-working-directory.yaml | 4 ++-- .github/workflows/schedule-detect-drifts.yaml | 10 +++++----- .github/workflows/sync-drift-issue-description.yaml | 2 +- .github/workflows/wc-plan.yaml | 10 +++++----- .github/workflows/wc-setup.yaml | 2 +- .github/workflows/wc-test-module.yaml | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/apply.yaml b/.github/workflows/apply.yaml index 18ccd8795..363ba972c 100644 --- a/.github/workflows/apply.yaml +++ b/.github/workflows/apply.yaml @@ -19,7 +19,7 @@ jobs: with: aqua_version: v2.21.0 - - uses: suzuki-shunsuke/tfaction/list-targets@pr/1291 + - uses: suzuki-shunsuke/tfaction/list-targets@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 id: list-targets apply: @@ -60,7 +60,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{ steps.aqua_installer_token.outputs.token }} - - uses: suzuki-shunsuke/tfaction/export-secrets@pr/1291 + - uses: suzuki-shunsuke/tfaction/export-secrets@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: secrets: ${{ toJSON(secrets) }} @@ -126,7 +126,7 @@ jobs: "test-tfaction-drift-issues" ] - - uses: suzuki-shunsuke/tfaction/setup@pr/1291 + - uses: suzuki-shunsuke/tfaction/setup@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{ steps.setup_token.outputs.token }} ssh_key: ${{ secrets.TERRAFORM_PRIVATE_MODULE_SSH_KEY }} # This isn't needed if you don't use SSH key to checkout private Terraform Modules @@ -152,7 +152,7 @@ jobs: "test-tfaction-drift-issues" ] - - uses: suzuki-shunsuke/tfaction/apply@pr/1291 + - uses: suzuki-shunsuke/tfaction/apply@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{ steps.apply_token.outputs.token }} @@ -175,12 +175,12 @@ jobs: "${{github.event.repository.name}}" ] - - uses: suzuki-shunsuke/tfaction/create-follow-up-pr@pr/1291 + - uses: suzuki-shunsuke/tfaction/create-follow-up-pr@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 if: failure() with: github_token: ${{steps.follow_up_pr_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/update-drift-issue@pr/1291 + - uses: suzuki-shunsuke/tfaction/update-drift-issue@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 if: always() with: status: ${{job.status}} diff --git a/.github/workflows/release-module.yaml b/.github/workflows/release-module.yaml index 50e0bdcdc..c2b73014a 100644 --- a/.github/workflows/release-module.yaml +++ b/.github/workflows/release-module.yaml @@ -24,7 +24,7 @@ jobs: with: aqua_version: v2.21.0 - - uses: suzuki-shunsuke/tfaction/release-module@pr/1291 + - uses: suzuki-shunsuke/tfaction/release-module@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: version: ${{ github.event.inputs.version }} module_path: ${{ github.event.inputs.module_path }} diff --git a/.github/workflows/scaffold-module.yaml b/.github/workflows/scaffold-module.yaml index d1d951e68..94b9791ec 100644 --- a/.github/workflows/scaffold-module.yaml +++ b/.github/workflows/scaffold-module.yaml @@ -44,10 +44,10 @@ jobs: repositories: >- ["${{github.event.repository.name}}"] - - uses: suzuki-shunsuke/tfaction/scaffold-module@pr/1291 + - uses: suzuki-shunsuke/tfaction/scaffold-module@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/create-scaffold-module-pr@pr/1291 + - uses: suzuki-shunsuke/tfaction/create-scaffold-module-pr@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} diff --git a/.github/workflows/scaffold-tfmigrate.yaml b/.github/workflows/scaffold-tfmigrate.yaml index 4bfe31576..af8c3da74 100644 --- a/.github/workflows/scaffold-tfmigrate.yaml +++ b/.github/workflows/scaffold-tfmigrate.yaml @@ -45,7 +45,7 @@ jobs: env: GITHUB_TOKEN: ${{github.token}} - - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@pr/1291 + - uses: suzuki-shunsuke/tfaction/scaffold-tfmigrate@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} migration_name: ${{github.event.inputs.migration_name}} diff --git a/.github/workflows/scaffold-working-directory.yaml b/.github/workflows/scaffold-working-directory.yaml index 997a0ecb9..2c3c9ce04 100644 --- a/.github/workflows/scaffold-working-directory.yaml +++ b/.github/workflows/scaffold-working-directory.yaml @@ -20,7 +20,7 @@ jobs: with: aqua_version: v2.21.0 - - uses: suzuki-shunsuke/tfaction/scaffold-working-dir@pr/1291 + - uses: suzuki-shunsuke/tfaction/scaffold-working-dir@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 - name: Generate token id: generate_token @@ -38,6 +38,6 @@ jobs: repositories: >- ["${{github.event.repository.name}}"] - - uses: suzuki-shunsuke/tfaction/create-scaffold-pr@pr/1291 + - uses: suzuki-shunsuke/tfaction/create-scaffold-pr@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/schedule-detect-drifts.yaml b/.github/workflows/schedule-detect-drifts.yaml index 070259973..2b19f6289 100644 --- a/.github/workflows/schedule-detect-drifts.yaml +++ b/.github/workflows/schedule-detect-drifts.yaml @@ -82,29 +82,29 @@ jobs: env: GITHUB_TOKEN: ${{github.token}} - - uses: suzuki-shunsuke/tfaction/set-drift-env@pr/1291 + - uses: suzuki-shunsuke/tfaction/set-drift-env@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: issue: ${{toJSON(matrix.issue)}} - - uses: suzuki-shunsuke/tfaction/setup@pr/1291 + - uses: suzuki-shunsuke/tfaction/setup@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/test@pr/1291 + - uses: suzuki-shunsuke/tfaction/test@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/terraform-plan@pr/1291 + - uses: suzuki-shunsuke/tfaction/terraform-plan@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/update-drift-issue@pr/1291 + - uses: suzuki-shunsuke/tfaction/update-drift-issue@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 if: always() with: status: ${{job.status}} diff --git a/.github/workflows/sync-drift-issue-description.yaml b/.github/workflows/sync-drift-issue-description.yaml index dbd6a1eda..8041c3b3e 100644 --- a/.github/workflows/sync-drift-issue-description.yaml +++ b/.github/workflows/sync-drift-issue-description.yaml @@ -14,4 +14,4 @@ jobs: permissions: issues: write steps: - - uses: suzuki-shunsuke/tfaction/sync-drift-issue-description@pr/1291 + - uses: suzuki-shunsuke/tfaction/sync-drift-issue-description@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 diff --git a/.github/workflows/wc-plan.yaml b/.github/workflows/wc-plan.yaml index 64ce2e1c1..01d8a44f5 100644 --- a/.github/workflows/wc-plan.yaml +++ b/.github/workflows/wc-plan.yaml @@ -53,7 +53,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{steps.aqua_installer_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/export-secrets@pr/1291 + - uses: suzuki-shunsuke/tfaction/export-secrets@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: secrets: ${{toJSON(secrets)}} @@ -95,13 +95,13 @@ jobs: repositories: >- ["${{github.event.repository.name}}"] - - uses: suzuki-shunsuke/tfaction/setup@pr/1291 + - uses: suzuki-shunsuke/tfaction/setup@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # For GitHub Provider - - uses: suzuki-shunsuke/tfaction/get-target-config@pr/1291 + - uses: suzuki-shunsuke/tfaction/get-target-config@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 id: target-config - name: Generate token (pull request write) @@ -131,13 +131,13 @@ jobs: - name: registry.terraform.io/integrations/github GITHUB_TOKEN: ${{steps.pull_request_token.outputs.token}} # For github-comment - - uses: suzuki-shunsuke/tfaction/test@pr/1291 + - uses: suzuki-shunsuke/tfaction/test@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # For GitHub Provider and reviewdog and github-comment - - uses: suzuki-shunsuke/tfaction/plan@pr/1291 + - uses: suzuki-shunsuke/tfaction/plan@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: diff --git a/.github/workflows/wc-setup.yaml b/.github/workflows/wc-setup.yaml index 81a6a8dbc..0800acc4e 100644 --- a/.github/workflows/wc-setup.yaml +++ b/.github/workflows/wc-setup.yaml @@ -54,7 +54,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} - - uses: suzuki-shunsuke/tfaction/list-targets@pr/1291 + - uses: suzuki-shunsuke/tfaction/list-targets@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 id: list-targets env: GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} diff --git a/.github/workflows/wc-test-module.yaml b/.github/workflows/wc-test-module.yaml index d2e2f60e7..16f6365fc 100644 --- a/.github/workflows/wc-test-module.yaml +++ b/.github/workflows/wc-test-module.yaml @@ -55,7 +55,7 @@ jobs: env: AQUA_GITHUB_TOKEN: ${{github.token}} - - uses: suzuki-shunsuke/tfaction/test-module@pr/1291 + - uses: suzuki-shunsuke/tfaction/test-module@e14be0997deaf47227d65f02dcff960fd1dcc862 # v1.0.0-1 with: github_token: ${{steps.generate_token.outputs.token}} env: