Skip to content

Commit 99577ad

Browse files
feat [EP-1505] IAM Name Prefix and Quiet output option (#1)
* Switch to name_prefix and allow quieting log out * Add ep * Remove actions * Revert "Remove actions" This reverts commit 5219164. * Revert "Add ep" This reverts commit 2f2b190. * Remove actions * Use different semantic release * Remove precommit * Add RR linting * Add tools versions * Update tfdocs
1 parent f48be17 commit 99577ad

File tree

11 files changed

+166
-273
lines changed

11 files changed

+166
-273
lines changed

.github/workflows/lock.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/pr-title.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/pull-requests.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
# cancel workflow runs in progress when a new commit comes through
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Get Terraform and TFLint versions from .tool-versions
24+
id: tool-versions
25+
run: |
26+
echo "terraform-version=$(cat .tool-versions | grep 'terraform' | awk '{print $2}')" >> "$GITHUB_OUTPUT"
27+
echo "tflint-version=$(cat .tool-versions | grep 'tflint' | awk '{print $2}')" >> "$GITHUB_OUTPUT"
28+
29+
- uses: hashicorp/setup-terraform@v3
30+
with:
31+
terraform_version: ${{ steps.tool-versions.outputs.terraform-version }}
32+
33+
- uses: terraform-linters/setup-tflint@v4
34+
with:
35+
tflint_version: ${{ format('v{0}', steps.tool-versions.outputs.tflint-version) }}
36+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
37+
github_token: ${{ github.token }}
38+
39+
- run: terraform init
40+
name: terraform init main module
41+
42+
- run: terraform validate
43+
name: terraform validate main module
44+
45+
- run: tflint --init
46+
name: tflint init main module
47+
48+
- run: tflint
49+
name: tflint main module
50+
51+
- run: |
52+
mkdir -p tmp && cd tmp
53+
curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.17.0/terraform-docs-v0.17.0-$(uname)-amd64.tar.gz
54+
tar -xzf terraform-docs.tar.gz
55+
chmod +x terraform-docs
56+
mv terraform-docs /usr/local/bin/terraform-docs
57+
cd .. && rm -rf tmp
58+
name: install tfdocs
59+
60+
- run: terraform-docs markdown table --output-file README.md --output-mode inject .
61+
name: tfdocs
62+
working-directory: .
63+
64+
- run: terraform-docs markdown table --output-file README.md --output-mode inject .
65+
name: tfdocs cloudwatch-logging
66+
working-directory: ./modules/cloudwatch-logging
67+
68+
- name: commit changes
69+
env:
70+
GH_TOKEN: ${{ github.token }}
71+
run: |
72+
git switch ${{ env.BRANCH_NAME }}
73+
git config --global user.email "[email protected]"
74+
git config --global user.name "DevOps"
75+
git add README.md
76+
git add modules/cloudwatch-logging/README.md
77+
export CHANGES=$(git diff --cached)
78+
if [ -n "$CHANGES" ]; then
79+
git commit -m "Update READMEs with Terraform Docs."
80+
git push
81+
fi

.github/workflows/release.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
1-
name: Release
1+
name: Create Release Version
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches:
76
- main
8-
- master
9-
paths:
10-
- '**/*.tpl'
11-
- '**/*.py'
12-
- '**/*.tf'
13-
- '.github/workflows/release.yml'
147

158
jobs:
169
release:
1710
name: Release
1811
runs-on: ubuntu-latest
19-
# Skip running release workflow on forks
20-
if: github.repository_owner == 'terraform-aws-modules'
2112
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
13+
- uses: actions/checkout@v3
2414
with:
25-
persist-credentials: false
2615
fetch-depth: 0
27-
28-
- name: Release
29-
uses: cycjimmy/semantic-release-action@v4
16+
- uses: paulhatch/[email protected]
17+
id: semantic-version
3018
with:
31-
semantic_version: 23.0.2
32-
extra_plugins: |
33-
@semantic-release/[email protected]
34-
@semantic-release/[email protected]
35-
19+
# The prefix to use to identify tags
20+
tag_prefix: "v"
21+
# A string which, if present in a git commit, indicates that a change represents a
22+
# major (breaking) change, supports regular expressions wrapped with '/'
23+
major_pattern: "(MAJOR)"
24+
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
25+
minor_pattern: "(MINOR)"
26+
# A string to determine the format of the version output
27+
version_format: "${major}.${minor}.${patch}"
28+
# If this is set to true, *every* commit will be treated as a new version.
29+
# Otherwise, only commits with diffs will be treated as a new version.
30+
bump_each_commit: false
31+
# If true, the body of commits will also be searched for major/minor patterns to determine the version type.
32+
search_commit_body: true
33+
- name: Tag & Release
34+
id: release-tag
3635
env:
37-
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
36+
GH_TOKEN: ${{ github.token }}
37+
run: |
38+
# Create tag for release.
39+
git tag ${{steps.semantic-version.outputs.version_tag }}
40+
git push origin ${{steps.semantic-version.outputs.version_tag }}
41+
42+
# Create release from tag.
43+
gh release create ${{steps.semantic-version.outputs.version_tag }} --generate-notes

.github/workflows/stale-actions.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tflint 0.50.3
2+
terraform 1.7.5

0 commit comments

Comments
 (0)