diff --git a/.github/workflows/wc-create-pr-branch.yaml b/.github/workflows/wc-create-pr-branch.yaml index e8a0ed266..2e124f786 100644 --- a/.github/workflows/wc-create-pr-branch.yaml +++ b/.github/workflows/wc-create-pr-branch.yaml @@ -191,6 +191,18 @@ jobs: TFACTION_WORKING_DIR: setup/test/foo TFACTION_JOB_TYPE: terraform + - name: Test OpenTofu (setup) + uses: ./setup + with: + github_token: ${{steps.token.outputs.token}} + if: | + ! github.event.pull_request.head.repo.fork + env: + TFACTION_CONFIG: setup/test/opentofu/tfaction-root.yaml + TFACTION_TARGET: setup/test/opentofu/foo + TFACTION_WORKING_DIR: setup/test/opentofu/foo + TFACTION_JOB_TYPE: terraform + - name: Test test uses: ./test with: diff --git a/aqua-checksums.json b/aqua-checksums.json index 654bfabaa..df846b245 100644 --- a/aqua-checksums.json +++ b/aqua-checksums.json @@ -60,6 +60,31 @@ "checksum": "6E4C6ACD38DE7B4B1BA8F8082B9E688DF8C9B861D3F8B2E7BB1B7270201A3587", "algorithm": "sha256" }, + { + "id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_darwin_amd64.zip", + "checksum": "7FF1307EC5DD14B2660EC91B39354CEC24AA492A03338D8A37FB542FB0B031F7", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_darwin_arm64.zip", + "checksum": "FEC8D934B9F69E033154265B60677604777505D3634945B3043C46E0030B5E5D", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_linux_amd64.zip", + "checksum": "6935F082EF120FDB05F608DDE61ACE6B82D134496634586F42C8E38856B3E411", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_linux_arm64.zip", + "checksum": "5CE3686C20C9D639E99A064AF5CF0D781361B0874426B2343A9AB4E33D25DB4F", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_windows_amd64.zip", + "checksum": "C63B55B322CA292491D8151CF24F43BA64F3522F896F13B16A49477A362580DF", + "algorithm": "sha256" + }, { "id": "github_release/github.com/reviewdog/reviewdog/v0.20.3/reviewdog_0.20.3_Darwin_arm64.tar.gz", "checksum": "A7FBF41913CE5B6F1872D10C136139B7A849190F4F1F0DC1ED4BF74C636F22A2", @@ -291,8 +316,8 @@ "algorithm": "sha256" }, { - "id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.280.0/registry.yaml", - "checksum": "6B5BB3DBC8AE412B5EF31232D06FBD81215E6431270FA7BAD4AAF0BC167C0A82", + "id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.282.0/registry.yaml", + "checksum": "58657FD69E9B7557F828DC0DF30134AE2D8E2111D3FA9347A376E14B9A7DE463", "algorithm": "sha256" } ] diff --git a/aqua/opentofu.yaml b/aqua/opentofu.yaml new file mode 100644 index 000000000..f734201df --- /dev/null +++ b/aqua/opentofu.yaml @@ -0,0 +1,2 @@ +packages: + - name: opentofu/opentofu@v1.8.7 diff --git a/setup/test/opentofu/foo/.terraform.lock.hcl b/setup/test/opentofu/foo/.terraform.lock.hcl new file mode 100644 index 000000000..309a9e0dc --- /dev/null +++ b/setup/test/opentofu/foo/.terraform.lock.hcl @@ -0,0 +1,22 @@ +# This file is maintained automatically by "tofu init". +# Manual edits may be lost in future updates. + +provider "registry.opentofu.org/hashicorp/null" { + version = "3.2.3" + constraints = "3.2.3" + hashes = [ + "h1:LF8arSzHfhbyQSFtTMTYEqCM34klzrbAQBJMHYCs9d8=", + "h1:ZD7F/BQPzRy/smJgSwnDs0vrqstk71sx2p0qtUcc/iU=", + "h1:nNa5j1vTtxcpdC2i61O2tRkZjdkBNsxzYXYIx0VNsjc=", + "zh:1d57d25084effd3fdfd902eca00020b34b1fb020253b84d7dd471301606015ac", + "zh:65b7f9799b88464d9c2ec529713b7f52ea744275b61a8dc86cdedab1b2dcb933", + "zh:80d3e9c95b7b4ae7c54005cd127cae82e5c53d2b7023ef24c147337bac9dadd9", + "zh:841b60c07683e4bf456799ccd718896fdafdcc2c49252ae09967f2e74d8c8a03", + "zh:8fa1c592a9c78222e35713c6edb3f1f818a4c6f3524a30a209f0a7e919827b68", + "zh:bb795cc1429e09466840c09d39a28edf1db5070b1ec76822fc1173906a264572", + "zh:da1784818a89bea29dfe660632f0060a7a843e4e564d74435fbeca002b0f7d2a", + "zh:f409bf21b1cdaa6dac47cd79806f3d93f67e9507fe4dbf33b0165335f53bc2e1", + "zh:fbea7a1ff84b430ba9594698e93196d81d03e4036de3d1cafccb2a96d5b38581", + "zh:fbf0c84663a7e85881388d7d71ac862184f05fbf2d17ecf76bc5d3d7503ea260", + ] +} diff --git a/setup/test/opentofu/foo/main.tf b/setup/test/opentofu/foo/main.tf new file mode 100644 index 000000000..3911a2a9b --- /dev/null +++ b/setup/test/opentofu/foo/main.tf @@ -0,0 +1 @@ +resource "null_resource" "foo" {} diff --git a/setup/test/opentofu/foo/providers.tf b/setup/test/opentofu/foo/providers.tf new file mode 100644 index 000000000..48a57f644 --- /dev/null +++ b/setup/test/opentofu/foo/providers.tf @@ -0,0 +1 @@ +provider "null" {} diff --git a/setup/test/opentofu/foo/terraform.tf b/setup/test/opentofu/foo/terraform.tf new file mode 100644 index 000000000..b8216cc10 --- /dev/null +++ b/setup/test/opentofu/foo/terraform.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + required_providers { + null = { + source = "hashicorp/null" + version = "3.2.3" + } + } +} diff --git a/setup/test/opentofu/foo/tfaction.yaml b/setup/test/opentofu/foo/tfaction.yaml new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/setup/test/opentofu/foo/tfaction.yaml @@ -0,0 +1 @@ +{} diff --git a/setup/test/opentofu/tfaction-root.yaml b/setup/test/opentofu/tfaction-root.yaml new file mode 100644 index 000000000..dc7f99de1 --- /dev/null +++ b/setup/test/opentofu/tfaction-root.yaml @@ -0,0 +1,61 @@ +--- +plan_workflow_name: test + +label_prefixes: + tfmigrate: "migrate:" +skip_terraform_by_renovate: true +renovate_terraform_labels: + - terraform +providers_lock_opts: -platform=linux_amd64 -platform=darwin_arm64 +tfcmt_plan_patch: true +# conftest_policy_directory: conftest-policy + +# skip_create_pr: true + +terraform_command: tofu + +conftest: + policies: + - policy: js/test/conftest/policy + tf: true + +update_local_path_module_caller: + enabled: true + +trivy: + enabled: true +tfsec: + enabled: false +tflint: + enabled: true + fix: true + +scaffold_working_directory: + skip_adding_aqua_packages: true + +# aqua: +# update_checksum: +# # Update aqua-checksums.json in `setup` action +# enabled: true # default is false +# skip_push: false # default is false +# prune: true # default is false + +update_related_pull_requests: + enabled: true + +drift_detection: + enabled: false + issue_repo_owner: suzuki-shunsuke + issue_repo_name: tfaction + minimum_detection_interval: 1 + num_of_issues: 1 + +replace: + patterns: + - regexp: /services/ + replace: / + +target_groups: + - working_directory: setup/test/ + target: setup/test/ + template_dir: js/test/templates/aws