-
Notifications
You must be signed in to change notification settings - Fork 32
feat(build): add terraform-docs generation pipeline #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
WilliamBerryiii
merged 9 commits into
main
from
feature/terraform-docs-generation-pipeline
Apr 6, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
67577b5
feat(build): add terraform-docs generation pipeline
WilliamBerryiii d74ec50
fix(build): use Write-Output for CI-parseable terraform-docs diff
WilliamBerryiii 5100b7c
feat(workflows): wire terraform-docs-check into CI with SHA256 verifi…
WilliamBerryiii 917db8f
fix(scripts): add parameters to Update-TerraformDocsCore for test iso…
847366a
Merge branch 'main' into feature/terraform-docs-generation-pipeline
WilliamBerryiii 4dfb090
fix(build): address PR review comments for terraform-docs pipeline
3712772
Merge branch 'main' into feature/terraform-docs-generation-pipeline
WilliamBerryiii 5e39877
Merge branch 'main' into feature/terraform-docs-generation-pipeline
WilliamBerryiii 3e1b2a7
Merge branch 'main' into feature/terraform-docs-generation-pipeline
WilliamBerryiii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Terraform Docs Check | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| soft-fail: | ||
| description: 'Whether to continue on terraform-docs drift detection' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| changed-files-only: | ||
| description: 'Only check directories with changed Terraform files' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| terraform-docs-version: | ||
| description: 'terraform-docs version to install' | ||
| required: false | ||
| type: string | ||
| default: 'v0.21.0' | ||
| terraform-docs-sha256: | ||
| description: 'SHA256 checksum of terraform-docs linux-amd64 tarball' | ||
| required: false | ||
| type: string | ||
| default: '2fdd81b8d21ff1498cd559af0dcc5d155835f84600db06d3923e217124fc735a' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: pwsh | ||
|
|
||
| jobs: | ||
| terraform-docs-check: | ||
| name: Terraform Docs Check | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: ${{ inputs.changed-files-only && '0' || '1' }} | ||
|
|
||
| - name: Create logs directory | ||
| run: New-Item -ItemType Directory -Force -Path logs | Out-Null | ||
|
|
||
| - name: Setup Node.js and install dependencies | ||
| uses: ./.github/actions/setup-node-deps | ||
|
|
||
| - name: Install terraform-docs | ||
| run: | | ||
| $version = '${{ inputs.terraform-docs-version }}' | ||
| $expectedSha = '${{ inputs.terraform-docs-sha256 }}' | ||
| $tarball = 'terraform-docs.tar.gz' | ||
| $url = "https://github.com/terraform-docs/terraform-docs/releases/download/${version}/terraform-docs-${version}-linux-amd64.tar.gz" | ||
|
|
||
| Invoke-WebRequest -Uri $url -OutFile $tarball | ||
|
|
||
| $actualSha = (Get-FileHash -Path $tarball -Algorithm SHA256).Hash.ToLowerInvariant() | ||
| if ($actualSha -ne $expectedSha) { | ||
| throw "SHA256 mismatch for terraform-docs ${version}: expected '${expectedSha}', got '${actualSha}'" | ||
| } | ||
| Write-Output "SHA256 verified: ${actualSha}" | ||
|
|
||
| tar -xzf $tarball | ||
| sudo mv terraform-docs /usr/local/bin/ | ||
| terraform-docs --version | ||
|
|
||
| - name: Run terraform-docs check | ||
| continue-on-error: ${{ inputs.soft-fail }} | ||
| run: | | ||
| $params = @{} | ||
| if ('${{ inputs.changed-files-only }}' -eq 'true') { | ||
| $params['ChangedFilesOnly'] = $true | ||
| } | ||
| shared/ci/linting/Invoke-TerraformDocsCheck.ps1 @params | ||
|
|
||
| - name: Upload terraform-docs check results | ||
| if: always() | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | ||
| with: | ||
| name: terraform-docs-check-results | ||
| path: logs/terraform-docs-check-results.json | ||
| retention-days: 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.