From c774f6b48576e5bf0e95439709e7cd34c4e7adcc Mon Sep 17 00:00:00 2001 From: Oanh Nguyen Date: Thu, 22 Feb 2024 16:43:02 +0700 Subject: [PATCH] Update Github Workflow --- .github/dependabot.yml | 10 ---------- .github/workflows/run-linting.yml | 30 +++++++++++++++++----------- .github/workflows/run-validation.yml | 24 +++++++++++----------- .tflint.hcl | 7 ++++++- README.md | 2 +- 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a4a3882..3e4ecd4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -22,13 +22,3 @@ updates: timezone: Asia/Ho_Chi_Minh labels: - dependencies - - - package-ecosystem: terraform - directory: /modules/ecr-lifecycle-policy - schedule: - interval: weekly - day: monday - time: "12:00" - timezone: Asia/Ho_Chi_Minh - labels: - - dependencies diff --git a/.github/workflows/run-linting.yml b/.github/workflows/run-linting.yml index 8e7c987..b0f7806 100644 --- a/.github/workflows/run-linting.yml +++ b/.github/workflows/run-linting.yml @@ -13,31 +13,37 @@ jobs: with: ref: ${{ github.head_ref }} - - name: Setup Terraform - uses: hashicorp/setup-terraform@v3 + - name: Setup Tofu + uses: opentofu/setup-opentofu@v1 - name: Setup TFLint uses: terraform-linters/setup-tflint@v4 - - name: Cache plugin dir - uses: actions/cache@v3 + - name: Cache terraform dir + uses: actions/cache@v4 with: - path: ~/.tflint.d/plugins - key: tflint-${{ hashFiles('.tflint.hcl') }} + path: ~/.terraform + key: terraform-${{ hashFiles('versions.tf') }} - - name: Run init - run: | - tflint --init - terraform init -upgrade + - name: Cache tflint dir + uses: actions/cache@v4 + with: + path: ~/.tflint.d + key: tflint-${{ hashFiles('.tflint.hcl') }} - name: Show version run: | - terraform --version + tofu --version tflint --version + - name: Run init + run: | + tflint --init + tofu init -upgrade + - name: Run linting run: | - terraform fmt --recursive + tofu fmt --recursive tflint -f compact --module - name: Commit changes diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index f18f7e6..82fd137 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -11,22 +11,22 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup Terraform - uses: hashicorp/setup-terraform@v3 + - name: Setup Tofu + uses: opentofu/setup-opentofu@v1 - - name: Show Terraform version - run: terraform --version - - - name: Cache plugin dir - uses: actions/cache@v3 + - name: Cache terraform dir + uses: actions/cache@v4 with: path: ~/.terraform key: terraform-${{ hashFiles('versions.tf') }} - - name: Init Terraform - run: terraform init -upgrade + - name: Show version + run: tofu --version + + - name: Run init + run: tofu init -upgrade - - name: Run Terraform validate + - name: Run validate run: | - terraform fmt --check - terraform validate + tofu fmt --check + tofu validate diff --git a/.tflint.hcl b/.tflint.hcl index 40f3633..f956124 100644 --- a/.tflint.hcl +++ b/.tflint.hcl @@ -2,8 +2,13 @@ config { module = true } +plugin "terraform" { + enabled = true + preset = "recommended" +} + plugin "aws" { source = "github.com/terraform-linters/tflint-ruleset-aws" - version = "0.21.1" + version = "0.30.0" enabled = true } diff --git a/README.md b/README.md index ca79283..7fbe610 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Terraform module which creates ECR repository resources on AWS. ```hcl module "php" { source = "rabiloo/ecr/aws" - version = "~> 0.2.1" + version = "~> 0.3.0" name = "app-name/php" image_tag_mutability = "MUTABLE"