Skip to content

Commit b1f740a

Browse files
committed
initial commit
0 parents  commit b1f740a

22 files changed

+1192
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
insert_final_newline = true
11+
max_line_length = 120
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
max_line_length = 0
16+
trim_trailing_whitespace = false
17+
18+
[{Makefile,**.mk}]
19+
indent_style = tab

.github/.templatesyncignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
README.md
2+
.github/workflows/*
3+
.terraform-docs.yml
4+
docs/20-badges.md
5+
*.tf

.github/pull_request-template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Please ensure your PR title is brief and descriptive for a good changelog entry -->
2+
<!-- Link to issue if there is one -->
3+
4+
## What it solves
5+
6+
...
7+
8+
## How this PR fixes it
9+
10+
...
11+
12+
## Readiness Checklist
13+
14+
### Author/Contributor
15+
- [ ] If documentation is needed for this change, has that been included in this pull request
16+
- [ ] Pull request title is brief and descriptive (for a changelog entry)
17+
18+
### Reviewing Maintainer
19+
- [ ] Label as `breaking` if this is a large fundamental change
20+
- [ ] Label as either `automation`, `bug`, `documentation`, or `enhancement`
21+
- [ ] Label as `bump:patch`, `bump:minor`, or `bump:major` if this PR should create a new release

.github/workflows/linter.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
################
3+
## Run linter ##
4+
################
5+
6+
#
7+
# Documentation:
8+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
9+
#
10+
11+
name: Lint
12+
on:
13+
push:
14+
branches: [ main ]
15+
pull_request:
16+
branches: [ main ]
17+
18+
##########################
19+
# Prevent duplicate jobs #
20+
##########################
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
24+
25+
permissions:
26+
contents: read
27+
pull-requests: write
28+
29+
###############
30+
# Run the job #
31+
###############
32+
jobs:
33+
##########
34+
# TF fmt #
35+
##########
36+
tf-fmt:
37+
name: FMT
38+
runs-on: ubuntu-latest
39+
steps:
40+
############################
41+
# Checkout the source code #
42+
############################
43+
- name: Checkout Code
44+
uses: actions/[email protected]
45+
46+
#####################
47+
# Run Terraform fmt #
48+
#####################
49+
- name: Terraform fmt
50+
uses: dflook/[email protected]
51+
52+
##########
53+
# TFLint #
54+
##########
55+
tf-lint:
56+
name: TFLint
57+
runs-on: ubuntu-latest
58+
steps:
59+
############################
60+
# Checkout the source code #
61+
############################
62+
- name: Checkout Code
63+
uses: actions/[email protected]
64+
65+
#################
66+
# Cache plugins #
67+
#################
68+
- name: Cache plugin dir
69+
uses: actions/[email protected]
70+
with:
71+
path: ~/.tflint.d/plugins
72+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
73+
74+
################
75+
# Setup TFLint #
76+
################
77+
- name: Setup TFLint
78+
uses: terraform-linters/setup-tflint@v2
79+
with:
80+
tflint_version: v0.42.2
81+
82+
###############
83+
# Init TFLint #
84+
###############
85+
- name: Init TFLint
86+
run: tflint --init
87+
88+
##############
89+
# Run TFLint #
90+
##############
91+
- name: Run TFLint
92+
run: tflint -f compact
93+
94+
###########
95+
# TF docs #
96+
###########
97+
tf-docs:
98+
name: Docs
99+
if: ${{ github.event_name == 'pull_request' }}
100+
permissions:
101+
contents: write
102+
pull-requests: write
103+
104+
runs-on: ubuntu-latest
105+
steps:
106+
############################
107+
# Checkout the source code #
108+
############################
109+
- name: Checkout Code
110+
uses: actions/[email protected]
111+
with:
112+
ref: ${{ github.event.pull_request.head.ref }}
113+
114+
####################
115+
# Update README.md #
116+
####################
117+
- name: Terraform docs
118+
uses: terraform-docs/[email protected]
119+
with:
120+
ref: ${{ github.event.pull_request.head.ref }}
121+
config-file: .terraform-docs.yml
122+
git-push: true

.github/workflows/release.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
####################################
3+
## Draft releases on Push to main ##
4+
####################################
5+
6+
#
7+
# Documentation:
8+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
9+
#
10+
11+
name: Release
12+
on:
13+
push:
14+
branches: [ main ]
15+
tags: [ 'v*.*.*' ]
16+
17+
permissions:
18+
contents: write
19+
20+
#################
21+
# Start the job #
22+
#################
23+
jobs:
24+
###############
25+
# Steps below #
26+
###############
27+
create-release:
28+
name: Create Release
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 10
31+
steps:
32+
############################
33+
# Checkout the source code #
34+
############################
35+
- name: Checkout Code
36+
uses: actions/[email protected]
37+
38+
###################################
39+
# Bump version depending on label #
40+
###################################
41+
- name: Bump version
42+
if: "!startsWith(github.ref, 'refs/tags/')"
43+
id: bumpr
44+
uses: haya14busa/action-bumpr@v1
45+
46+
###################
47+
# Update the tags #
48+
###################
49+
- name: Update tag
50+
if: "!steps.bumpr.outputs.skip"
51+
uses: haya14busa/action-update-semver@v1
52+
with:
53+
tag: ${{ steps.bumpr.outputs.next_version }}
54+
55+
################
56+
# Get tag name #
57+
################
58+
- name: Get tag name
59+
id: tag
60+
uses: haya14busa/action-cond@v1
61+
with:
62+
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
63+
if_true: ${{ github.ref }}
64+
if_false: ${{ steps.bumpr.outputs.next_version }}
65+
66+
##################
67+
# Create release #
68+
##################
69+
- name: Create release
70+
uses: softprops/action-gh-release@v1
71+
if: "steps.tag.outputs.value != ''"
72+
with:
73+
name: Release ${{ steps.tag.outputs.value }}
74+
body: ${{ steps.bumpr.outputs.message }}
75+
tag_name: ${{ steps.tag.outputs.value }}
76+
draft: false
77+
prerelease: false

.github/workflows/semantic-pr.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
#####################
3+
## Run Semantic PR ##
4+
#####################
5+
6+
#
7+
# Documentation:
8+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
9+
#
10+
11+
name: Semantic PR
12+
on:
13+
pull_request:
14+
types: [ opened, edited, synchronize ]
15+
16+
##########################
17+
# Prevent duplicate jobs #
18+
##########################
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
pull-requests: write
26+
27+
###############
28+
# Run the job #
29+
###############
30+
jobs:
31+
###############
32+
# Semantic PR #
33+
###############
34+
semantic-pr:
35+
name: Validate PR
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 5
38+
steps:
39+
############
40+
# Check PR #
41+
############
42+
- name: Check PR
43+
id: lint-pr-title
44+
uses: amannn/[email protected]
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
#############################
49+
# Add PR comment with error #
50+
#############################
51+
- name: Add PR error comment
52+
uses: marocchino/[email protected]
53+
if: always() && (steps.lint-pr-title.outputs.error_message != null)
54+
with:
55+
header: pr-title-lint-error
56+
message: |
57+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
58+
59+
Details:
60+
61+
```
62+
${{ steps.lint-pr-title.outputs.error_message }}
63+
```
64+
65+
################################
66+
# Delete PR comment with error #
67+
################################
68+
- name: Delete PR error comment
69+
uses: marocchino/[email protected]
70+
if: ${{ steps.lint_pr_title.outputs.error_message == null }}
71+
with:
72+
header: pr-title-lint-error
73+
delete: true

.github/workflows/sync-templates.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
#########################
3+
## Sync template files ##
4+
#########################
5+
6+
#
7+
# Documentation:
8+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
9+
#
10+
11+
name: Sync templates
12+
on:
13+
workflow_dispatch: # Trigger manually
14+
schedule:
15+
- cron: "0 0 1 * *" # Run at 00:00 on the first day of every month
16+
17+
##########################
18+
# Prevent duplicate jobs #
19+
##########################
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
23+
24+
###############
25+
# Run the job #
26+
###############
27+
jobs:
28+
###############
29+
# Sync labels #
30+
###############
31+
sync-labels:
32+
name: Sync labels
33+
runs-on: ubuntu-latest
34+
steps:
35+
##################################
36+
# Sync labels with template Repo #
37+
##################################
38+
- name: Sync labels
39+
uses: EndBug/[email protected]
40+
with:
41+
config-file: https://gist.githubusercontent.com/Ic3w0lf/f5520c5f19d7098966f692c120f7a197/raw/75b134f76fbc55e2e64bd66f04e571d6d74b815e/terraform-aws-module-labels.yaml
42+
43+
#######################
44+
# Sync template files #
45+
#######################
46+
sync-template-files:
47+
name: Sync template files
48+
runs-on: ubuntu-latest
49+
steps:
50+
############################
51+
# Checkout the source code #
52+
############################
53+
- name: Checkout Code
54+
uses: actions/[email protected]
55+
56+
#######################
57+
# Sync template files #
58+
#######################
59+
- name: actions-template-sync
60+
uses: AndreasAugustin/[email protected]
61+
with:
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
source_repo_path: geekcell/terraform-aws-module-template

0 commit comments

Comments
 (0)