Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrTitov authored Apr 14, 2023
0 parents commit b5d7a54
Show file tree
Hide file tree
Showing 13 changed files with 590 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "actions-update"
- "bot"
35 changes: 35 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Validate PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
pr-title:
name: 'Title'
runs-on: ubuntu-20.04
permissions: write-all
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: amannn/action-semantic-pull-request@v5
with:
types: |
fix
feat
docs
ci
chore
refactor
revert
requireScope: false
subjectPattern: ^[A-Z].+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.
wip: true
validateSingleCommit: false
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Release'

on:
push:
branches:
- master
paths:
- '**/*.tpl'
- '*.tf'

jobs:
release:
name: 'Release'
runs-on: ubuntu-20.04
permissions: write-all
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: 'Release'
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 18.0.0
extra_plugins: |
@semantic-release/changelog@6.0.0
@semantic-release/git@10.0.0
conventional-changelog-conventionalcommits@4.6.3
61 changes: 61 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'Terraform'

env:
tf_version: 1.4.4

on:
pull_request:
paths:
- '*.tf'
- '**/*.tpl'

jobs:
linters:
name: 'Linters'
runs-on: ubuntu-20.04
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Setup Terraform'
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.tf_version }}
terraform_wrapper: false
- name: 'Format'
id: fmt
continue-on-error: false
run: |
echo "::notice::Executing 'terraform fmt' for the module"
if [ $(terraform fmt -check --list=true -diff=true -write=false | tee fmt-issues | wc -c) -ne 0 ]; then
echo "::error::Terraform module has to be formatted!"
echo "::error::Apply 'terraform fmt' to the module to fix the formatting issues:"
cat fmt-issues
exit 1
else
echo "::notice::Terraform module does not have any formatting issues"
fi
- name: 'Validate'
id: validate
continue-on-error: false
run: |
echo "::notice::Executing 'terraform init && terraform validate' to the module"
terraform init -input=false && terraform validate
docs:
name: 'Docs'
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: 'Render terraform docs and push changes back to PR'
uses: terraform-docs/gh-actions@v1
with:
working-dir: .
output-file: README.md
output-method: inject
git-push: "true"
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Idea IDE
.idea
*.iml
44 changes: 44 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"branches": [
"master"
],
"ci": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file."
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Loading

0 comments on commit b5d7a54

Please sign in to comment.