Skip to content

Commit 06717ac

Browse files
new workflows
1 parent b9f79af commit 06717ac

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/create-root-readme.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: create-root-readme
22

33
on:
4+
workflow_dispatch:
5+
46
workflow_run:
57
workflows: [ "generate-terraform-docs" ] # Runs after completion of generate-terraform-docs workflow
68
types:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: terraform-fmt
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- '**.tf'
11+
- '**.tfvars'
12+
- '**.tfvars.json'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
terraform-fmt:
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Check out the repository
24+
uses: actions/checkout@v4
25+
26+
- name: Token generator
27+
uses: githubofkrishnadhas/github-access-using-githubapp@v2
28+
id: token-generation
29+
with:
30+
github_app_id: ${{ secrets.TOKEN_GENERATOR_APPID }}
31+
github_app_private_key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }}
32+
33+
- name: Set up Terraform
34+
uses: hashicorp/setup-terraform@v2
35+
with:
36+
terraform_version: 1.7.6
37+
38+
- name: Run the tree generation script
39+
run: |
40+
terraform fmt -recursive -check
41+
42+
- name: Commit and Push Changes
43+
env:
44+
GITHUB_TOKEN: ${{ steps.token-generation.outputs.token }}
45+
run: |
46+
git config user.name 'github-actions-bot'
47+
git config user.email 'actions@github.com'
48+
git add .
49+
git commit -m "terraform fmt checks"
50+
git push

0 commit comments

Comments
 (0)