Skip to content

Commit f6d9d6e

Browse files
author
Michael Saki
committed
Add ATX Header Support for terraform-docs
This is a temporary fix until @mcdonnnj has his PR approved and merged into the terraform-docs repo. This fix will perform a shallow clone of his forked branch, build the binary, and install it.
1 parent c0eed09 commit f6d9d6e

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ on:
88
types: [apb]
99

1010
env:
11+
BRANCH_NAME: improvement/support_atx_closed_markdown_headers
1112
CURL_CACHE_DIR: ~/.cache/curl
13+
DEPTH: 1
1214
PIP_CACHE_DIR: ~/.cache/pip
1315
PRE_COMMIT_CACHE_DIR: ~/.cache/pre-commit
16+
REPO_URL: https://github.com/mcdonnnj/terraform-docs.git
1417
RUN_TMATE: ${{ secrets.RUN_TMATE }}
1518

1619
jobs:
@@ -124,11 +127,20 @@ jobs:
124127
PACKAGE_URL: honnef.co/go/tools/cmd/staticcheck
125128
PACKAGE_VERSION: ${{ steps.setup-env.outputs.staticcheck-version }}
126129
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
127-
- name: Install Terraform-docs
128-
env:
129-
PACKAGE_URL: github.com/terraform-docs/terraform-docs
130-
PACKAGE_VERSION: ${{ steps.setup-env.outputs.terraform-docs-version }}
131-
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
130+
# We are temporarily using @mcdonnnj's forked branch of terraform-docs
131+
# until his PR: https://github.com/terraform-docs/terraform-docs/pull/745
132+
# is approved. This temporary fix will allow for ATX Header Support when
133+
# terraform-docs is ran during lint.
134+
- name: Clone ATX Headers branch from Terraform-docs Fork
135+
run: |
136+
git clone --branch $BRANCH_NAME --single-branch \
137+
--depth=$DEPTH $REPO_URL /tmp/terraform-docs
138+
- name: Build and Install Terraform-docs Binary
139+
run: |
140+
cd /tmp/terraform-docs
141+
GOBIN=$(go env GOPATH)/bin
142+
go build -o $GOBIN/terraform-docs
143+
echo "$GOBIN" >> $GITHUB_PATH
132144
- name: Install dependencies
133145
run: |
134146
python -m pip install --upgrade pip setuptools wheel

0 commit comments

Comments
 (0)