Skip to content

Commit f46bfa5

Browse files
Merge pull request #19 from terraform-module/chore/refresh
keep up-to-date. update .github actions
2 parents 1627651 + 211825c commit f46bfa5

File tree

8 files changed

+134
-51
lines changed

8 files changed

+134
-51
lines changed

.github/workflows/lint.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: linter
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
8+
env:
9+
# renovate: datasource=github-releases depName=terraform-linters/tflint
10+
TFLINT_VERSION: v0.34.0
11+
12+
jobs:
13+
tflint:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
name: Checkout source code
23+
24+
- uses: actions/cache@v2
25+
name: Cache plugin dir
26+
with:
27+
path: ~/.tflint.d/plugins
28+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
29+
30+
- uses: terraform-linters/setup-tflint@v1
31+
name: Setup TFLint
32+
with:
33+
tflint_version: ${{ env.RENOVATE_CONFIG_FOLDER }}
34+
35+
- name: Show version
36+
run: tflint --version
37+
38+
- name: Init TFLint
39+
run: tflint --init
40+
41+
- name: Run TFLint
42+
run: tflint -f compact

.github/workflows/main.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/pr-title.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 'validate-pr-title'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: validate pr title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/[email protected]
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
docs
27+
ci
28+
chore
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# If `subjectPattern` is configured, you can use this property to override
32+
# the default error message that is shown when the pattern doesn't match.
33+
# The variables `subject` and `title` can be used within the message.
34+
subjectPatternError: |
35+
The subject "{subject}" found in the pull request title "{title}"
36+
didn't match the configured pattern. Please ensure that the subject
37+
starts with an uppercase character.
38+
# For work-in-progress PRs you can typically use draft pull requests
39+
# from Github. However, private repositories on the free plan don't have
40+
# this option and therefore this action allows you to opt-in to using the
41+
# special "[WIP]" prefix to indicate this state. This will avoid the
42+
# validation of the PR title and the pull request checks remain pending.
43+
# Note that a second check will be reported if this is enabled.
44+
wip: true
45+
# When using "Squash and merge" on a PR with only one commit, GitHub
46+
# will suggest using that commit message instead of the PR title for the
47+
# merge commit, and it's easy to commit this by mistake. Enable this option
48+
# to also validate the commit message for one commit PRs.
49+
validateSingleCommit: false

.github/workflows/release.draft.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ on:
1010
description: Is this a pre-release
1111
required: true
1212
default: true
13+
type: boolean
1314
publish:
1415
description: Publish release
1516
required: false
1617
default: false
18+
type: boolean
1719
bump:
1820
description: 'Bumping (#major, #minor or #patch)'
1921
required: false
2022
default: patch
23+
type: choice
24+
options:
25+
- 'patch'
26+
- 'minor'
27+
- 'major'
2128

2229
jobs:
2330
draft-a-release:

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@ repos:
1616
- id: check-merge-conflict
1717
- id: detect-aws-credentials
1818
args: ['--allow-missing-credentials']
19-
- repo: git://github.com/antonbabenko/pre-commit-terraform
19+
- repo: https://github.com/antonbabenko/pre-commit-terraform
2020
rev: v1.70.1
2121
hooks:
2222
- id: terraform_fmt
2323
- id: terraform_docs
2424
- id: terraform_tflint
25-
- repo: git://github.com/smian/pre-commit-makefile
26-
rev: 261f8fb4b31dfdc05d1a1d7fbde1f1462ecde66d
27-
hooks:
28-
- id: makefile-doc

.tflint.hcl

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
1+
config {
2+
module = false
3+
}
4+
15
plugin "aws" {
26
enabled = true
3-
deep_check = true
7+
version = "0.13.3"
8+
source = "github.com/terraform-linters/tflint-ruleset-aws"
49
}
510

6-
rule "terraform_documented_variables" {
11+
rule "terraform_comment_syntax" {
712
enabled = true
813
}
914

10-
rule "terraform_documented_outputs" {
15+
rule "terraform_deprecated_index" {
1116
enabled = true
1217
}
1318

14-
rule "terraform_comment_syntax" {
19+
rule "terraform_deprecated_interpolation" {
1520
enabled = true
1621
}
1722

18-
rule "terraform_naming_convention" {
23+
rule "terraform_documented_outputs" {
1924
enabled = true
2025
}
2126

22-
rule "terraform_deprecated_interpolation" {
27+
rule "terraform_documented_variables" {
2328
enabled = true
2429
}
2530

26-
rule "terraform_deprecated_index" {
31+
rule "terraform_module_pinned_source" {
32+
enabled = true
33+
style = "flexible"
34+
}
35+
36+
rule "terraform_module_version" {
2737
enabled = true
2838
}
2939

30-
rule "terraform_required_providers" {
40+
rule "terraform_naming_convention" {
3141
enabled = true
42+
format = "snake_case"
3243
}
3344

34-
rule "terraform_required_version" {
45+
rule "terraform_standard_module_structure" {
3546
enabled = true
3647
}
3748

@@ -42,3 +53,7 @@ rule "terraform_typed_variables" {
4253
rule "terraform_unused_declarations" {
4354
enabled = true
4455
}
56+
57+
rule "terraform_unused_required_providers" {
58+
enabled = true
59+
}

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Terraform module `terraform-aws-enforce-mfa`
44

5+
---
6+
57
[![](https://img.shields.io/github/license/terraform-module/terraform-aws-enforce-mfa)](https://github.com/terraform-module/terraform-aws-enforce-mfa)
68
![](https://img.shields.io/github/v/tag/terraform-module/terraform-aws-enforce-mfa)
79
[![](https://img.shields.io/github/workflow/status/terraform-module/terraform-aws-enforce-mfa/commit-check/master)](https://github.com/terraform-module/terraform-aws-enforce-mfa/actions?query=is%3Acompleted)
@@ -18,6 +20,8 @@ Terraform module `terraform-aws-enforce-mfa`
1820
![](https://img.shields.io/github/last-commit/terraform-module/terraform-aws-enforce-mfa)
1921
[![Maintenance](https://img.shields.io/badge/Maintenu%3F-oui-green.svg)](https://GitHub.com/terraform-module/terraform-aws-enforce-mfa/graphs/commit-activity)
2022

23+
---
24+
2125
## Documentations
2226

2327
- [aws-vault setup](https://github.com/99designs/aws-vault)
@@ -59,7 +63,7 @@ resource aws_iam_group support {
5963
6064
module enforce_mfa {
6165
source = "terraform-module/enforce-mfa/aws"
62-
version = "0.12.0"
66+
version = "~> 1.0"
6367
6468
policy_name = "managed-mfa-enforce"
6569
account_id = data.aws_caller_identity.current.id
@@ -130,9 +134,9 @@ No modules.
130134

131135
<!-- START makefile-doc -->
132136
```
133-
$ make help
137+
$ make help
134138
hooks Commit hooks setup
135-
validate Validate with pre-commit hooks
139+
validate Validate with pre-commit hooks
136140
```
137141
<!-- END makefile-doc -->
138142

examples/basic/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
data aws_caller_identity current {}
1+
data "aws_caller_identity" "current" {}
22

3-
resource aws_iam_group support {
3+
resource "aws_iam_group" "support" {
44
name = "support"
55
}
66

7-
module enforce_mfa {
7+
module "enforce_mfa" {
88
source = "terraform-module/enforce-mfa/aws"
9-
version = "0.12.0"
9+
version = "~> 1.0"
1010

1111
policy_name = "managed-mfa-enforce"
1212
account_id = data.aws_caller_identity.current.id

0 commit comments

Comments
 (0)