File tree Expand file tree Collapse file tree 11 files changed +157
-0
lines changed
Expand file tree Collapse file tree 11 files changed +157
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Auto-tag
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ tag-new-versions :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v2
14+ with :
15+ fetch-depth : 2
16+ - uses : salsify/action-detect-and-tag-new-version@v2
17+ with :
18+ tag-template : " {VERSION}"
19+ version-command : |
20+ [ -f .version ] && cat .version || echo "v0.0.0"
Original file line number Diff line number Diff line change 1+ # vim temporaries
2+ * .sw [p|o|n ]
3+
4+ # python bytecode
5+ * .py [c|o ]
6+
7+ # system files
8+ .zfs
9+ .DS_Store
10+ . * .swp
11+ * ~
12+
13+ # Ansible
14+ * .retry
15+
16+ # Terraform
17+ .terraform
18+ * .tfplan
19+
20+ # Directories used by IDEs
21+ nbproject
22+ .idea
23+ .project
24+ .settings
25+
26+ # SSH Private keys
27+ * .priv
28+
29+ # Terragrunt
30+ .terragrunt-cache
31+ .terraform.lock.hcl
Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : git://github.com/antonbabenko/pre-commit-terraform
3+ rev : v1.48.0
4+ hooks :
5+ - id : terraform_fmt
6+ - id : terraform_docs
7+ files : ^.*(.md|.tf|.version)$
8+ args :
9+ - --args=--config=.terraform-docs.yml
10+ - repo : https://github.com/pre-commit/pre-commit-hooks
11+ rev : v2.3.0
12+ hooks :
13+ - id : end-of-file-fixer
Original file line number Diff line number Diff line change 1+ formatter : markdown table
2+
3+ content : |-
4+ {{ .Requirements }}
5+ {{ .Modules }}
6+ {{ .Providers }}
7+ {{ .Resources }}
8+ {{ .Inputs }}
9+ {{ .Outputs }}
10+
11+ {{/* EXAMPLES */}}{{
12+ with $version := include ".version"
13+ }}{{
14+ $template := include "./examples/examples.md"
15+ }}{{
16+ range $match := regexFindAll "{{ include \".*\" }}" $template -1
17+ }}{{
18+ $fileName := index (regexSplit "\"" $match -1) 1
19+ }}{{
20+ $template = replace $match (include (print "./examples/" $fileName)) $template
21+ }}{{
22+ $template = replace "{{ provider_version }}" $version $template
23+ }}{{
24+ end
25+ }}{{
26+ $template
27+ }}{{
28+ end
29+ }}
30+
31+
32+ output :
33+ file : " README.md"
34+ mode : inject
35+ template : |-
36+ <!-- START_OF_AUTO_GENERATED_SECTION -->
37+ {{ .Content }}
38+ <!-- END_OF_AUTO_GENERATED_SECTION -->
39+
40+ sort :
41+ enabled : false
42+
43+ settings :
44+ anchor : true
45+ color : true
46+ default : true
47+ description : true
48+ escape : true
49+ hide-empty : true
50+ html : true
51+ indent : 2
52+ lockfile : true
53+ read-comments : true
54+ required : true
55+ sensitive : true
56+ type : true
Original file line number Diff line number Diff line change 1+ v0.0.1
Original file line number Diff line number Diff line change 1+ # template of terraform resource repository
2+
3+ <!-- START_OF_AUTO_GENERATED_SECTION -->
4+ <!-- END_OF_AUTO_GENERATED_SECTION -->
5+
6+ ## Enabling pre-commit hooks
7+
8+ Following pre-commit hooks are provided:
9+
10+ - [ terraform-fmt] ( https://github.com/antonbabenko/pre-commit-terraform#terraform_fmt ) to check syntax of terraform
11+ - [ terraform-docs] ( https://github.com/terraform-docs/terraform-docs ) to recreate README.md according to terraform module properties
12+ - [ end-of-file-fixer] ( https://github.com/pre-commit/pre-commit-hooks#end-of-file-fixer ) to ensure that each file ends with newline
13+
14+ ### Requirements
15+
16+ - [ pre-commit] ( https://pre-commit.com/#installation )
17+
18+ ### Installation
19+ To install ` pre-commit ` check .
20+
21+ ``` bash
22+ pre-commit install
23+ ```
Original file line number Diff line number Diff line change 1+ ## Examples
2+
3+ ### Basic example
4+ ``` hcl
5+ {{ include "./basic/main.tf" }}
6+ ```
You can’t perform that action at this time.
0 commit comments