Skip to content

Commit

Permalink
Update Github Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed Feb 22, 2024
1 parent 84281df commit c774f6b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 36 deletions.
10 changes: 0 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 18 additions & 12 deletions .github/workflows/run-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/run-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion .tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c774f6b

Please sign in to comment.