File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 11name : create-root-readme
22
33on :
4+ workflow_dispatch :
5+
46 workflow_run :
57 workflows : [ "generate-terraform-docs" ] # Runs after completion of generate-terraform-docs workflow
68 types :
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments