Skip to content

Commit f3bed51

Browse files
authored
Initial commit
0 parents  commit f3bed51

13 files changed

+443
-0
lines changed

Diff for: .editorconfig

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
# Uses editorconfig to maintain consistent coding styles
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
indent_size = 2
12+
indent_style = space
13+
insert_final_newline = true
14+
max_line_length = 80
15+
trim_trailing_whitespace = true
16+
17+
[*.{tf,tfvars}]
18+
indent_size = 2
19+
indent_style = space
20+
21+
[*.md]
22+
max_line_length = 0
23+
trim_trailing_whitespace = false
24+
25+
[Makefile]
26+
tab_width = 2
27+
indent_style = tab
28+
29+
[COMMIT_EDITMSG]
30+
max_line_length = 0

Diff for: .github/workflows/documentation.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Generate terraform docs
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- master
7+
8+
jobs:
9+
AutogenerateTerraformRepoDocs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
ref: ${{ github.event.pull_request.head.ref }}
15+
16+
- name: Render terraform docs and push changes back to PR
17+
uses: terraform-docs/gh-actions@main
18+
with:
19+
working-dir: .
20+
output-file: README.md
21+
output-method: inject
22+
git-push: "true"

Diff for: .github/workflows/kics_sec_scan.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run security KICS scaner
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
kics:
10+
name: Run security KICS scaner
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- name: Checkout code repo
15+
uses: actions/checkout@v3
16+
17+
- name: Run security KICS scaner
18+
uses: checkmarx/[email protected]
19+
with:
20+
path: .
21+
output_path: myResults/
22+
output_formats: 'sarif'
23+
enable_comments: true
24+
enable_annotations: true
25+
ignore_on_exit: results
26+
27+
# TBD
28+
# - name: Upload SARIF file
29+
# uses: github/codeql-action/upload-sarif@v1
30+
# with:
31+
# sarif_file: myResults/results.sarif

Diff for: .github/workflows/pr-validate.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Lint PR"
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+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
# Configure which types are allowed.
20+
# Default: https://github.com/commitizen/conventional-commit-types
21+
types: |
22+
fix
23+
feat
24+
docs
25+
ci
26+
chore
27+
# Configure that a scope must always be provided.
28+
requireScope: false
29+
# Configure additional validation for the subject based on a regex.
30+
# This example ensures the subject doesn't start with an uppercase character.
31+
subjectPattern: ^(?![A-Z]).+$
32+
# If `subjectPattern` is configured, you can use this property to override
33+
# the default error message that is shown when the pattern doesn't match.
34+
# The variables `subject` and `title` can be used within the message.
35+
subjectPatternError: |
36+
The subject "{subject}" found in the pull request title "{title}"
37+
didn't match the configured pattern. Please ensure that the subject
38+
doesn't start with an uppercase character.
39+
40+
# If you're using a format for the PR title that differs from the traditional Conventional
41+
# Commits spec, you can use these options to customize the parsing of the type, scope and
42+
# subject. The `headerPattern` should contain a regex where the capturing groups in parentheses
43+
# correspond to the parts listed in `headerPatternCorrespondence`.
44+
# See: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#headerpattern
45+
headerPattern: '^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$'
46+
headerPatternCorrespondence: type, scope, subject
47+
# For work-in-progress PRs you can typically use draft pull requests
48+
# from GitHub. However, private repositories on the free plan don't have
49+
# this option and therefore this action allows you to opt-in to using the
50+
# special "[WIP]" prefix to indicate this state. This will avoid the
51+
# validation of the PR title and the pull request checks remain pending.
52+
# Note that a second check will be reported if this is enabled.
53+
wip: true

Diff for: .github/workflows/pre-commit.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Pre-Commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- master
8+
9+
env:
10+
TERRAFORM_DOCS_VERSION: v0.16.0
11+
12+
jobs:
13+
collectInputs:
14+
name: Collect workflow inputs
15+
runs-on: ubuntu-latest
16+
outputs:
17+
directories: ${{ steps.dirs.outputs.directories }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Get root directories
23+
id: dirs
24+
uses: clowdhaus/terraform-composite-actions/[email protected]
25+
26+
preCommitMinVersions:
27+
name: Min TF pre-commit
28+
needs: collectInputs
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v3
36+
37+
- name: Terraform min/max versions
38+
id: minMax
39+
uses: clowdhaus/[email protected]
40+
with:
41+
directory: ${{ matrix.directory }}
42+
43+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
44+
# Run only validate pre-commit check on min version supported
45+
if: ${{ matrix.directory != '.' }}
46+
uses: clowdhaus/terraform-composite-actions/[email protected]
47+
with:
48+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
49+
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
50+
51+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
52+
# Run only validate pre-commit check on min version supported
53+
if: ${{ matrix.directory == '.' }}
54+
uses: clowdhaus/terraform-composite-actions/[email protected]
55+
with:
56+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
57+
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
58+
59+
preCommitMaxVersion:
60+
name: Max TF pre-commit
61+
runs-on: ubuntu-latest
62+
needs: collectInputs
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
with:
67+
ref: ${{ github.event.pull_request.head.ref }}
68+
repository: ${{github.event.pull_request.head.repo.full_name}}
69+
70+
- name: Terraform min/max versions
71+
id: minMax
72+
uses: clowdhaus/[email protected]
73+
74+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
75+
uses: clowdhaus/terraform-composite-actions/[email protected]
76+
with:
77+
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
78+
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}

Diff for: .github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
paths:
10+
- '**/*.tpl'
11+
- '**/*.py'
12+
- '**/*.tf'
13+
- '.github/workflows/release.yml'
14+
15+
jobs:
16+
release:
17+
name: Release
18+
runs-on: ubuntu-latest
19+
# Skip running release workflow on forks
20+
if: github.repository_owner == 'data-platform-hq'
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Release
28+
uses: cycjimmy/semantic-release-action@v3
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: .github/workflows/stale-actions.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Mark or close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v5
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
# Staling issues and PR's
14+
days-before-stale: 30
15+
stale-issue-label: stale
16+
stale-pr-label: stale
17+
stale-issue-message: |
18+
This issue has been automatically marked as stale because it has been open 30 days
19+
with no activity. Remove stale label or comment or this issue will be closed in 10 days
20+
stale-pr-message: |
21+
This PR has been automatically marked as stale because it has been open 30 days
22+
with no activity. Remove stale label or comment or this PR will be closed in 10 days
23+
# Not stale if have this labels or part of milestone
24+
exempt-issue-labels: bug,wip,on-hold
25+
exempt-pr-labels: bug,wip,on-hold
26+
exempt-all-milestones: true
27+
# Close issue operations
28+
# Label will be automatically removed if the issues are no longer closed nor locked.
29+
days-before-close: 10
30+
delete-branch: true
31+
close-issue-message: This issue was automatically closed because of stale in 10 days
32+
close-pr-message: This PR was automatically closed because of stale in 10 days

Diff for: .gitignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.DS_Store
2+
3+
# Local .terraform directories
4+
**/.terraform/*
5+
6+
# Terraform lockfile
7+
.terraform.lock.hcl
8+
9+
# .tfstate files
10+
*.tfstate
11+
*.tfstate.*
12+
*.tfplan
13+
14+
# Crash log files
15+
crash.log
16+
17+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
18+
# password, private keys, and other secrets. These should not be part of version
19+
# control as they are data points which are potentially sensitive and subject
20+
# to change depending on the environment.
21+
*.tfvars
22+
23+
# Ignore override files as they are usually used to override resources locally and so
24+
# are not checked in
25+
override.tf
26+
override.tf.json
27+
*_override.tf
28+
*_override.tf.json
29+
30+
# Ignore CLI configuration files
31+
.terraformrc
32+
terraform.rc
33+
34+
# Exclude vscode files
35+
.vscode/*
36+
37+
# Exclude idea files
38+
.idea/*

Diff for: .pre-commit-config.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
repos:
2+
- repo: https://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.75.0
4+
hooks:
5+
- id: terraform_fmt
6+
- id: terraform_validate
7+
- id: terraform_tflint
8+
args:
9+
- '--args=--only=terraform_deprecated_interpolation'
10+
- '--args=--only=terraform_deprecated_index'
11+
- '--args=--only=terraform_unused_declarations'
12+
- '--args=--only=terraform_comment_syntax'
13+
- '--args=--only=terraform_documented_outputs'
14+
- '--args=--only=terraform_documented_variables'
15+
- '--args=--only=terraform_typed_variables'
16+
- '--args=--only=terraform_module_pinned_source'
17+
- '--args=--only=terraform_naming_convention'
18+
- '--args=--only=terraform_required_version'
19+
- '--args=--only=terraform_required_providers'
20+
- '--args=--only=terraform_standard_module_structure'
21+
- '--args=--only=terraform_workspace_remote'
22+
- repo: https://github.com/pre-commit/pre-commit-hooks
23+
rev: v4.3.0
24+
hooks:
25+
- id: check-merge-conflict
26+
- id: end-of-file-fixer

Diff for: .releaserc.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"branches": [
3+
"main",
4+
"master"
5+
],
6+
"ci": true,
7+
"dryRun": false,
8+
"plugins": [
9+
"@semantic-release/commit-analyzer",
10+
"@semantic-release/release-notes-generator",
11+
"@semantic-release/changelog",
12+
[
13+
"@semantic-release/github",
14+
{
15+
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
16+
"labels": false,
17+
"releasedLabels": false
18+
}
19+
],
20+
[
21+
"@semantic-release/git",
22+
{
23+
"assets": [
24+
"CHANGELOG.md"
25+
],
26+
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
27+
}
28+
]
29+
]
30+
}

0 commit comments

Comments
 (0)