Skip to content

Commit 1ea8a6c

Browse files
committed
ci: add terraform-docs to ci workflow
1 parent 985a359 commit 1ea8a6c

File tree

2 files changed

+133
-120
lines changed

2 files changed

+133
-120
lines changed

.github/workflows/ci-terraform.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ jobs:
2020
name: Terraform CI
2121
permissions:
2222
pull-requests: write
23+
contents: write
2324
runs-on: ubuntu-latest
2425
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
2526
steps:
2627
- uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
30+
2731
- uses: hashicorp/setup-terraform@v3
2832

29-
- name: Terraform fmt
33+
- name: Terraform Format
3034
id: fmt
3135
run: terraform fmt -check
3236
continue-on-error: true
@@ -38,3 +42,11 @@ jobs:
3842
- name: Terraform Validate
3943
id: validate
4044
run: terraform validate -no-color
45+
46+
- name: Terraform Docs
47+
uses: terraform-docs/gh-actions@v1.3.0
48+
with:
49+
working-dir: .
50+
output-file: README.md
51+
output-method: print
52+
fail-on-diff: true

0 commit comments

Comments
 (0)