Skip to content

Commit 7894cb9

Browse files
committed
Add terraform format
1 parent 5b345a4 commit 7894cb9

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Terraform Format
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
#tf_token_keeper_path:
7+
# required: true
8+
# type: string
9+
parent_tf_dir:
10+
required: true
11+
type: string
12+
description: Parent directory where all Terraform files are underneath
13+
default: "."
14+
cli_opts:
15+
required: false
16+
type: string
17+
default: " "
18+
19+
jobs:
20+
terraform_fmt:
21+
runs-on: self-hosted
22+
container:
23+
image: buildpack-deps:bookworm
24+
steps:
25+
#- name: Retrieve secrets from Keeper
26+
# id: ksecrets
27+
# uses: Keeper-Security/ksm-action@master
28+
# with:
29+
# keeper-secret-config: ${{ secrets.KSM_CONFIG }}
30+
# secrets: |-
31+
# ${{ inputs.tf_token_keeper_path }} > env:TF_TOKEN
32+
- name: Checkout source code
33+
uses: actions/checkout@v4
34+
- name: Setup Nodejs
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: lts/*
38+
check-latest: true
39+
- name: Setup Terraform
40+
uses: hashicorp/setup-terraform@v3
41+
with:
42+
cli_config_credentials_token: AAA
43+
- name: Terraform Format
44+
run: |
45+
cd $TF_DIR
46+
terraform fmt -recursive -check ${{ inputs.cli_opts }} .

0 commit comments

Comments
 (0)