Skip to content

Commit 8d42258

Browse files
committed
initial commit
0 parents  commit 8d42258

32 files changed

+2652
-0
lines changed

.editorconfig

+19
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/labels.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
- name: 'bump:major'
2+
color: ef6bb4
3+
description: 'Attach to PR to automatically bump major version on merge'
4+
aliases: [ ]
5+
6+
- name: 'bump:minor'
7+
color: ef6bb4
8+
description: 'Attach to PR to automatically bump minor version on merge'
9+
aliases: [ ]
10+
11+
- name: 'bump:patch'
12+
color: ef6bb4
13+
description: 'Attach to PR to automatically bump patch version on merge'
14+
aliases: [ ]
15+
16+
- name: 'automation'
17+
color: 3ddd1b
18+
description: 'Removing manual tasks by automating them'
19+
aliases: [ ]
20+
21+
- name: 'bug'
22+
color: d73a4a
23+
description: 'Something is not working'
24+
aliases: [ ]
25+
26+
- name: 'documentation'
27+
color: 0075ca
28+
description: 'Improvements or additions to documentation'
29+
aliases: [ ]
30+
31+
- name: 'enhancement'
32+
color: a2eeef
33+
description: 'New feature or request'
34+
aliases: [ ]

.github/pull_request-template.md

+21
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

+122
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

+77
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

+73
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

0 commit comments

Comments
 (0)