Skip to content

Commit 9c80ff9

Browse files
authored
chore: update examples and CI workflows (#7)
1 parent 9af356b commit 9c80ff9

File tree

17 files changed

+154
-704
lines changed

17 files changed

+154
-704
lines changed

.github/images/bridgecrew.svg

Lines changed: 1 addition & 1 deletion
Loading

.github/workflows/pre-commit.yml

Lines changed: 78 additions & 0 deletions
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@v2
21+
22+
- name: Get root directories
23+
id: dirs
24+
uses: clowdhaus/terraform-composite-actions/directories@v1.3.0
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@v2
36+
37+
- name: Terraform min/max versions
38+
id: minMax
39+
uses: clowdhaus/terraform-min-max@v1.0.3
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/pre-commit@v1.3.0
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/pre-commit@v1.3.0
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@v2
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/terraform-min-max@v1.0.3
73+
74+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
75+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0
76+
with:
77+
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
78+
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}

.github/workflows/semantic-releaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: release
22

33
on:
44
push:
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
release:
13-
name: Release
13+
name: release
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
@@ -26,5 +26,5 @@ jobs:
2626

2727
- name: Release
2828
env:
29-
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
3030
run: npx semantic-release

.github/workflows/static-checks.yml

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

0 commit comments

Comments
 (0)