Skip to content

Commit 9020b55

Browse files
authored
Merge pull request #164 from cisagov/improvement/install_atx_header_support_terraform-docs
Add ATX Header Support for `terraform-docs`
2 parents 4f73489 + c907cfc commit 9020b55

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/build.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ env:
2424
PIP_CACHE_DIR: ~/.cache/pip
2525
PRE_COMMIT_CACHE_DIR: ~/.cache/pre-commit
2626
RUN_TMATE: ${{ secrets.RUN_TMATE }}
27+
TERRAFORM_DOCS_REPO_BRANCH_NAME: improvement/support_atx_closed_markdown_headers
28+
TERRAFORM_DOCS_REPO_DEPTH: 1
29+
TERRAFORM_DOCS_REPO_URL: https://github.com/mcdonnnj/terraform-docs.git
2730

2831
jobs:
2932
diagnostics:
@@ -136,11 +139,23 @@ jobs:
136139
PACKAGE_URL: honnef.co/go/tools/cmd/staticcheck
137140
PACKAGE_VERSION: ${{ steps.setup-env.outputs.staticcheck-version }}
138141
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
139-
- name: Install Terraform-docs
140-
env:
141-
PACKAGE_URL: github.com/terraform-docs/terraform-docs
142-
PACKAGE_VERSION: ${{ steps.setup-env.outputs.terraform-docs-version }}
143-
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
142+
# TODO: https://github.com/cisagov/skeleton-generic/issues/165
143+
# We are temporarily using @mcdonnnj's forked branch of terraform-docs
144+
# until his PR: https://github.com/terraform-docs/terraform-docs/pull/745
145+
# is approved. This temporary fix will allow for ATX header support when
146+
# terraform-docs is run during linting.
147+
- name: Clone ATX headers branch from terraform-docs fork
148+
run: |
149+
git clone \
150+
--branch $TERRAFORM_DOCS_REPO_BRANCH_NAME \
151+
--depth $TERRAFORM_DOCS_REPO_DEPTH \
152+
--single-branch \
153+
$TERRAFORM_DOCS_REPO_URL /tmp/terraform-docs
154+
- name: Build and install terraform-docs binary
155+
run: |
156+
go build \
157+
-C /tmp/terraform-docs \
158+
-o $(go env GOPATH)/bin/terraform-docs
144159
- name: Install dependencies
145160
run: |
146161
python -m pip install --upgrade pip setuptools wheel

0 commit comments

Comments
 (0)