Skip to content

Commit a3b861e

Browse files
sync with terraform bootstrap project
1 parent 8dedbaf commit a3b861e

File tree

14 files changed

+177
-233
lines changed

14 files changed

+177
-233
lines changed

.chglog/CHANGELOG.tpl.md

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

.chglog/config.yml

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

.editorconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# top-most EditorConfig file
2-
root = true
3-
42
[*]
53
end_of_line = lf
64
charset = utf-8

.github/settings.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
_extends: .github
3+
4+
repository:
5+
# See https://developer.github.com/v3/repos/#edit for all available settings.
6+
name: terraform-kubernetes-velero
7+
description: "ℹ️ Velero release with terraform and helm."
8+
homepage: https://ivankatliarchuk.github.io
9+
topics: ivank, terraform, terraform-module, helm, kubernetes, velero
10+
private: false
11+
has_issues: true
12+
has_projects: false
13+
has_wiki: false
14+
has_downloads: false
15+
has_pages: true
16+
is_template: true
17+
default_branch: master
18+
allow_squash_merge: true
19+
allow_merge_commit: true
20+
allow_rebase_merge: true
21+
delete_branch_on_merge: true
22+
enable_automated_security_fixes: true
23+
enable_vulnerability_alerts: false
24+
25+
branches:
26+
- name: master

.github/workflows/linter.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: linter
3+
# This workflow is triggered on pushes to the repository.
4+
on:
5+
push:
6+
pull_request:
7+
branches:
8+
- main
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
terraform-validate:
14+
name: code format
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
# https://github.com/hashicorp/setup-terraform
19+
- uses: hashicorp/setup-terraform@v2
20+
21+
- name: Cache terraform folder
22+
uses: actions/cache@v3
23+
with:
24+
path: ./.terraform
25+
key: terraform
26+
27+
- name: terraform fmt
28+
run: terraform fmt -check -recursive -diff
29+
continue-on-error: true
30+
31+
- name: terraform init
32+
run: terraform init
33+
34+
- name: terraform validate
35+
run: terraform validate
36+
37+
tflint:
38+
name: "tflint"
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
- uses: actions/cache@v3
43+
name: Cache tflint plugin dir
44+
with:
45+
path: ~/.tflint.d/plugins
46+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
47+
- uses: terraform-linters/setup-tflint@v2
48+
name: setup tflint
49+
- name: init tflint
50+
run: tflint --init --config .tflint.hcl
51+
- name: run tflint
52+
run: tflint -f compact --config .tflint.hcl

.github/workflows/main.yaml

Lines changed: 0 additions & 26 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: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: release.draft
23

34
on:
@@ -10,32 +11,39 @@ on:
1011
description: Is this a pre-release
1112
required: true
1213
default: true
14+
type: boolean
1315
publish:
1416
description: Publish release
1517
required: false
1618
default: false
19+
type: boolean
1720
bump:
1821
description: 'Bumping (#major, #minor or #patch)'
1922
required: false
2023
default: patch
24+
type: choice
25+
options:
26+
- 'patch'
27+
- 'minor'
28+
- 'major'
2129

2230
jobs:
2331
draft-a-release:
2432
runs-on: ubuntu-latest
2533
steps:
2634

27-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
2836

2937
- name: check next version
30-
uses: anothrNick/github-tag-action@1.38.0
38+
uses: anothrNick/github-tag-action@1.39.0
3139
id: tag
3240
env:
3341
DRY_RUN: true
3442
WITH_V: true
3543
DEFAULT_BUMP: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.bump || 'patch' }}
3644

3745
- name: release-draft
38-
uses: release-drafter/release-drafter@v5.15.0
46+
uses: release-drafter/release-drafter@v5.20.0
3947
if: "!contains(github.event.head_commit.message, 'skip')"
4048
id: release
4149
env:

.pre-commit-config.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.0.1
3+
rev: v4.3.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=500']
77
- id: check-executables-have-shebangs
88
- id: pretty-format-json
9-
args: ['--autofix', '--no-sort-keys', '--indent=4']
9+
args: ['--autofix', '--no-sort-keys', '--indent=2']
1010
- id: check-byte-order-marker
1111
- id: check-case-conflict
1212
- id: check-executables-have-shebangs
@@ -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
20-
rev: v1.51.0
19+
- repo: https://github.com/antonbabenko/pre-commit-terraform
20+
rev: v1.74.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: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
11
config {
2-
ignore_module = {}
3-
varfile = []
2+
module = false
43
}
54

6-
rule "terraform_documented_variables" {
5+
plugin "aws" {
76
enabled = true
7+
version = "0.13.3"
8+
source = "github.com/terraform-linters/tflint-ruleset-aws"
89
}
910

10-
rule "terraform_documented_outputs" {
11+
rule "terraform_comment_syntax" {
1112
enabled = true
1213
}
1314

14-
rule "terraform_comment_syntax" {
15+
rule "terraform_deprecated_index" {
1516
enabled = true
1617
}
1718

18-
rule "terraform_naming_convention" {
19+
rule "terraform_deprecated_interpolation" {
1920
enabled = true
2021
}
2122

22-
rule "terraform_deprecated_interpolation" {
23+
rule "terraform_documented_outputs" {
2324
enabled = true
2425
}
2526

26-
rule "terraform_deprecated_index" {
27+
rule "terraform_documented_variables" {
2728
enabled = true
2829
}
2930

30-
rule "terraform_required_providers" {
31+
rule "terraform_module_pinned_source" {
3132
enabled = true
33+
style = "flexible"
3234
}
3335

34-
rule "terraform_required_version" {
36+
rule "terraform_module_version" {
37+
enabled = true
38+
}
39+
40+
rule "terraform_naming_convention" {
41+
enabled = true
42+
format = "snake_case"
43+
}
44+
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+
}

0 commit comments

Comments
 (0)