Skip to content

Commit

Permalink
ci: Fix 'invalid character 'c' in tfplugindocs 0.7
Browse files Browse the repository at this point in the history
Not sure why this occurs, but it seems only to be an issue if it uses
terraform from PATH (which started in v0.7.0) - if it acquires (the same
version of) terraform itself, it's fine.

But also only in CI - it worked fine (with terraform on PATH) for me locally.

cf. hashicorp/terraform-plugin-docs#127
  • Loading branch information
OJFord committed Mar 17, 2022
1 parent 4559955 commit 961f73b
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: Go
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.18

Expand Down Expand Up @@ -50,8 +50,36 @@ jobs:
go mod tidy
git diff --exit-code
terraform:
name: Terraform
terraform-docs:
name: Terraform docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Check docs updated
run: |
version=0.7.0
curl \
-L https://github.com/hashicorp/terraform-plugin-docs/releases/download/v${version}/tfplugindocs_${version}_linux_amd64.zip \
--output tfplugindocs.zip
unzip tfplugindocs.zip tfplugindocs
go version
terraform --version
./tfplugindocs --version
./tfplugindocs generate
change="$(git diff)"
if [ -n "$change" ]; then
>&2 echo "$change"
exit 1
fi
terraform-examples:
name: Terraform examples
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -64,19 +92,15 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.18

- name: Terraformat
run: terraform fmt -recursive examples

- name: Check examples
run: make examples

- name: Check docs updated
run: |
curl -L https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.7.0/tfplugindocs_0.7.0_linux_amd64.zip --output tfplugindocs.zip
unzip tfplugindocs.zip tfplugindocs
./tfplugindocs
change="$(git diff)"
if [ -n "$change" ]; then
>&2 echo "$change"
exit 1
fi

0 comments on commit 961f73b

Please sign in to comment.