Skip to content

Commit 8b113d9

Browse files
authored
Merge pull request #17 from lablabs/feat/template-alignment
feat: align addon with latest template
2 parents 8990dc8 + 547007d commit 8b113d9

22 files changed

+537
-263
lines changed

.github/RELEASE_DRAFTER.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,25 @@ categories:
77
- 'enhancement'
88
- title: 'Bug Fixes'
99
labels:
10-
- 'fix'
11-
- 'bugfix'
1210
- 'bug'
1311
- title: 'Documentation'
1412
label: 'documentation'
13+
- title: 'CI'
14+
label: 'ci'
15+
version-resolver:
16+
major:
17+
labels:
18+
- 'major'
19+
minor:
20+
labels:
21+
- 'feature'
22+
- 'enhancement'
23+
patch:
24+
labels:
25+
- 'ci'
26+
- 'bug'
27+
- 'documentation'
28+
default: patch
1529
change-template: '- $TITLE, by @$AUTHOR (#$NUMBER)'
1630
template: |
1731
# What's changed

.github/workflows/pre-commit.yml

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: pre-commit
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_dispatch:
58
pull_request:
@@ -8,36 +11,42 @@ on:
811
- master
912

1013
env:
14+
PYTHON_VERSION: "3.10"
1115
TERRAFORM_DOCS_VERSION: "v0.16.0"
12-
TFLINT_VERSION: "v0.36.2"
16+
TFLINT_VERSION: "v0.40.1"
1317

1418
jobs:
1519
pre-commit:
16-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1723
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-python@v2
20-
21-
- name: Install additional pre-commit hooks
22-
shell: bash
23-
run: |
24-
echo "########### Install Checkov ####################"
25-
pip install checkov
26-
27-
echo "########### Install Terraform-docs #############"
28-
wget https://github.com/terraform-docs/terraform-docs/releases/download/${{ env.TERRAFORM_DOCS_VERSION }}/terraform-docs-${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz
29-
tar xvzf terraform-docs-${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz
30-
mkdir -p ~/terraform-docs/bin/
31-
install terraform-docs ~/terraform-docs/bin/
32-
echo '~/terraform-docs/bin/' >> $GITHUB_PATH
33-
34-
echo "########### Install Terraform-linters ##########"
35-
wget https://github.com/terraform-linters/tflint/releases/download/${{ env.TFLINT_VERSION }}/tflint_linux_amd64.zip
36-
unzip tflint_linux_amd64.zip
37-
mkdir -p ~/tflint/bin/
38-
echo '~/tflint/bin/' >> $GITHUB_PATH
39-
install tflint ~/tflint/bin/
40-
~/tflint/bin/tflint --init
41-
42-
- name: Run pre-commit
43-
uses: pre-commit/[email protected]
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ env.PYTHON_VERSION }}
28+
cache: pip
29+
30+
- name: Install Python dependencies
31+
run: pip install -r requirements.txt
32+
33+
- name: Install terraform-docs
34+
uses: jaxxstorm/[email protected]
35+
with:
36+
repo: terraform-docs/terraform-docs
37+
tag: ${{ env.TERRAFORM_DOCS_VERSION }}
38+
cache: enable
39+
40+
- name: TFLint cache
41+
uses: actions/cache@v3
42+
with:
43+
path: ~/.tflint.d/plugins
44+
key: ${{ runner.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
45+
46+
- name: Install TFLint
47+
uses: terraform-linters/setup-tflint@v2
48+
with:
49+
tflint_version: ${{ env.TFLINT_VERSION }}
50+
51+
- name: Run pre-commit
52+
uses: pre-commit/[email protected]

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
update_release_draft:
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-22.04
1919
steps:
2020
- uses: release-drafter/release-drafter@v5
2121
with:

.github/workflows/validate.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Terraform validate
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_dispatch:
58
pull_request:
@@ -10,11 +13,11 @@ on:
1013
jobs:
1114
versionExtract:
1215
name: Extract min/max Terraform versions
13-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-22.04
1417

1518
steps:
1619
- name: Checkout
17-
uses: actions/checkout@v2
20+
uses: actions/checkout@v3
1821

1922
- name: Extract Terraform min/max versions
2023
id: minMax
@@ -26,7 +29,7 @@ jobs:
2629
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
2730

2831
terraform-validate:
29-
runs-on: ubuntu-20.04
32+
runs-on: ubuntu-22.04
3033
needs: versionExtract
3134
strategy:
3235
matrix:
@@ -35,7 +38,7 @@ jobs:
3538
- ${{ needs.versionExtract.outputs.maxVersion }}
3639

3740
steps:
38-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@v3
3942
- uses: hashicorp/setup-terraform@v2
4043
with:
4144
terraform_version: ${{ matrix.tf_ver }}

.pre-commit-config.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.2.0
3+
rev: v4.3.0
44
hooks:
55
- id: trailing-whitespace
66
- id: check-merge-conflict
@@ -10,23 +10,18 @@ repos:
1010
- id: end-of-file-fixer
1111

1212
- repo: https://github.com/antonbabenko/pre-commit-terraform
13-
rev: v1.71.0
13+
rev: v1.75.0
1414
hooks:
15-
- id: terraform_fmt
16-
- id: terraform_tflint
17-
- id: terraform_validate
18-
- id: terraform_checkov
19-
- id: terraform_docs
20-
args:
21-
- '--args=--hide providers --sort-by required'
22-
23-
- repo: https://github.com/pecigonzalo/pre-commit-terraform-vars
24-
rev: v1.0.0
25-
hooks:
26-
- id: terraform-vars
15+
- id: terraform_fmt
16+
- id: terraform_tflint
17+
- id: terraform_validate
18+
- id: terraform_checkov
19+
- id: terraform_docs
20+
args:
21+
- '--args=--config=.terraform-docs.yml'
2722

2823
- repo: https://github.com/Yelp/detect-secrets
29-
rev: v1.2.0
24+
rev: v1.3.0
3025
hooks:
3126
- id: detect-secrets
3227
args: ['--baseline', '.secrets.baseline']

.secrets.baseline

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
2-
"custom_plugin_paths": [],
3-
"exclude": {
4-
"files": null,
5-
"lines": null
6-
},
7-
"generated_at": "2020-09-21T15:31:24Z",
2+
"version": "1.3.0",
83
"plugins_used": [
4+
{
5+
"name": "ArtifactoryDetector"
6+
},
97
{
108
"name": "AWSKeyDetector"
119
},
1210
{
13-
"name": "ArtifactoryDetector"
11+
"name": "AzureStorageKeyDetector"
1412
},
1513
{
16-
"base64_limit": 4.5,
17-
"name": "Base64HighEntropyString"
14+
"name": "Base64HighEntropyString",
15+
"limit": 4.5
1816
},
1917
{
2018
"name": "BasicAuthDetector"
@@ -23,8 +21,11 @@
2321
"name": "CloudantDetector"
2422
},
2523
{
26-
"hex_limit": 3,
27-
"name": "HexHighEntropyString"
24+
"name": "GitHubTokenDetector"
25+
},
26+
{
27+
"name": "HexHighEntropyString",
28+
"limit": 3.0
2829
},
2930
{
3031
"name": "IbmCloudIamDetector"
@@ -36,32 +37,77 @@
3637
"name": "JwtTokenDetector"
3738
},
3839
{
39-
"keyword_exclude": null,
40-
"name": "KeywordDetector"
40+
"name": "KeywordDetector",
41+
"keyword_exclude": ""
4142
},
4243
{
4344
"name": "MailchimpDetector"
4445
},
46+
{
47+
"name": "NpmDetector"
48+
},
4549
{
4650
"name": "PrivateKeyDetector"
4751
},
52+
{
53+
"name": "SendGridDetector"
54+
},
4855
{
4956
"name": "SlackDetector"
5057
},
5158
{
5259
"name": "SoftlayerDetector"
5360
},
61+
{
62+
"name": "SquareOAuthDetector"
63+
},
5464
{
5565
"name": "StripeDetector"
5666
},
5767
{
5868
"name": "TwilioKeyDetector"
5969
}
6070
],
71+
"filters_used": [
72+
{
73+
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
74+
},
75+
{
76+
"path": "detect_secrets.filters.common.is_baseline_file",
77+
"filename": ".secrets.baseline"
78+
},
79+
{
80+
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
81+
"min_level": 2
82+
},
83+
{
84+
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
85+
},
86+
{
87+
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
88+
},
89+
{
90+
"path": "detect_secrets.filters.heuristic.is_lock_file"
91+
},
92+
{
93+
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
94+
},
95+
{
96+
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
97+
},
98+
{
99+
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
100+
},
101+
{
102+
"path": "detect_secrets.filters.heuristic.is_sequential_string"
103+
},
104+
{
105+
"path": "detect_secrets.filters.heuristic.is_swagger_file"
106+
},
107+
{
108+
"path": "detect_secrets.filters.heuristic.is_templated_secret"
109+
}
110+
],
61111
"results": {},
62-
"version": "0.14.3",
63-
"word_list": {
64-
"file": null,
65-
"hash": null
66-
}
112+
"generated_at": "2022-07-28T10:50:47Z"
67113
}

.terraform-docs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
formatter: markdown table
2+
3+
output:
4+
mode: inject
5+
template: |-
6+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
7+
{{ .Content }}
8+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
9+
10+
sections:
11+
hide:
12+
- providers
13+
14+
sort:
15+
by: required

.tflint.hcl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugin "terraform" {
2+
enabled = true
3+
version = "0.1.1"
4+
source = "github.com/terraform-linters/tflint-ruleset-terraform"
5+
preset = "recommended"
6+
}
7+
plugin "aws" {
8+
enabled = true
9+
version = "0.17.0"
10+
source = "github.com/terraform-linters/tflint-ruleset-aws"
11+
}

0 commit comments

Comments
 (0)