From d254d395c29a7ffcd84bdbe41f37ae2551518fb6 Mon Sep 17 00:00:00 2001 From: Volodymyr Syromiatnykov <vladimir.fess@gmail.com> Date: Wed, 24 Jan 2024 09:45:22 -0500 Subject: [PATCH 1/3] ci: update WF version and add dependabot config file --- .github/dependabot.yml | 14 ++++++++++++++ .github/workflows/docs.yml | 2 +- .github/workflows/labeler.yml | 2 +- .github/workflows/labels.yml | 3 +-- .github/workflows/pr-lint.yml | 24 ++++++++++++++++++++---- .github/workflows/release.yml | 1 - .github/workflows/stale.yml | 2 +- .github/workflows/terraform.yml | 6 +++--- .github/workflows/tflint.yml | 8 ++++---- .github/workflows/tfsec.yml | 8 ++++---- README.md | 2 +- examples/basic/README.md | 4 +++- examples/basic/versions.tf | 3 +++ versions.tf | 2 +- 14 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 examples/basic/versions.tf diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8a080f2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "chore" + - package-ecosystem: "terraform" + directory: "/" + schedule: + interval: "weekly" + labels: + - "chore" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 00091d3..18e97b4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 6e90a14..e1edd65 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -8,7 +8,7 @@ jobs: name: Auto Label runs-on: ubuntu-latest steps: - - uses: fuxingloh/multi-labeler@v2.0.2 + - uses: fuxingloh/multi-labeler@v2.0.3 with: github-token: ${{ secrets.GITHUB_TOKEN }} config-path: .github/labeler.yml diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 44a6aab..f1fa7af 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -3,7 +3,6 @@ name: Sync labels on: push: branches: - - master - main jobs: @@ -12,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Sync labels uses: micnncim/action-label-syncer@v1.3.0 diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index ade3195..eebe319 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,12 @@ name: PR title conformance on: - pull_request_target: + # pull_request_target: + pull_request: + types: + - opened + - edited + - synchronize jobs: lint-pr: @@ -9,15 +14,26 @@ jobs: steps: - name: Lint PR - uses: aslafy-z/conventional-pr-title-action@v3.0.0 + uses: amannn/action-semantic-pull-request@v5 with: - preset: conventional-changelog-angular@^5.0.6 + types: | + build + ci + docs + feat + fix + perf + refactor + style + test + chore + requireScope: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Comment for PR title conformance if: failure() - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v3 with: issue-number: ${{tojson(github.event.number)}} body: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0db1b0..3d57aca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,6 @@ name: Release Drafter on: push: branches: - - master - main jobs: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 29083b7..4828253 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/stale@v6 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days" diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 99e1d12..3adcfb3 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.3.0 + terraform_version: 1.6.6 - name: Ensure Terraform code is formated run: terraform fmt -check diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index c32a059..7697fbf 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.3.0 + terraform_version: 1.6.6 - name: Terraform Init run: terraform init @@ -25,5 +25,5 @@ jobs: github_token: ${{ secrets.github_token }} reporter: github-pr-review fail_on_error: "true" - filter_mode: "nofilter" + filter_mode: "diff_context" flags: "--module" diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index aae03e4..b497166 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -10,12 +10,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.3.0 + terraform_version: 1.6.6 - name: Terraform Init run: terraform init @@ -25,6 +25,6 @@ jobs: with: github_token: ${{ secrets.github_token }} reporter: github-pr-review - filter_mode: nofilter + filter_mode: diff_context fail_on_error: true tfsec_flags: "--exclude-downloaded-modules" diff --git a/README.md b/README.md index 783b30a..4d2d6d9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ module "aweasome_module" { | Name | Version | |------|---------| -| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 | +| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 | ## Providers No providers. diff --git a/examples/basic/README.md b/examples/basic/README.md index 91131eb..911d7d1 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -1,7 +1,9 @@ <!-- BEGIN_TF_DOCS --> ## Requirements -No requirements. +| Name | Version | +|------|---------| +| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 | ## Providers diff --git a/examples/basic/versions.tf b/examples/basic/versions.tf new file mode 100644 index 0000000..6964268 --- /dev/null +++ b/examples/basic/versions.tf @@ -0,0 +1,3 @@ +terraform { + required_version = ">= 1.3" +} diff --git a/versions.tf b/versions.tf index 7117131..6964268 100644 --- a/versions.tf +++ b/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.3" } From 08e5f710f36fa74ece238cfd7a8af878b841cea7 Mon Sep 17 00:00:00 2001 From: Volodymyr Syromiatnykov <vladimir.fess@gmail.com> Date: Wed, 24 Jan 2024 09:47:59 -0500 Subject: [PATCH 2/3] upd --- .github/workflows/pr-lint.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index eebe319..427f354 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,8 +1,7 @@ name: PR title conformance on: - # pull_request_target: - pull_request: + pull_request_target: types: - opened - edited From 50eb0149c026b2c7be657f904523d356335a326f Mon Sep 17 00:00:00 2001 From: Volodymyr Syromiatnykov <vladimir.fess@gmail.com> Date: Wed, 24 Jan 2024 09:50:05 -0500 Subject: [PATCH 3/3] upd --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 18e97b4..2dfbbaf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,6 +17,7 @@ jobs: working-dir: ./examples/basic/ git-push: "false" output-file: README.md + config-file: ./examples/basic/.terraform-docs.yml - name: Render terraform docs inside the README.md uses: terraform-docs/gh-actions@v1.0.0