Skip to content
play-circle

GitHub Action

Setup Terraform docs

v1.0.4 Latest version

Setup Terraform docs

play-circle

Setup Terraform docs

Install and setup Terraform docs executable

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Terraform docs

uses: lablabs/[email protected]

Learn more about this action in lablabs/setup-terraform-docs

Choose a version

⛔️ DEPRECATED

This is no longer supported, please consider using install-gh-release instead.

Setup Terraform docs Action

A GitHub action that installs a Terraform docs executable in the PATH.

Inputs

terraform_docs_version

Required The version of Terraform docs which will be installed. See Terraform docs releases page for valid versions.

If version is "latest", the action will get the latest version number using Octokit.

Default "latest".

token

If set, token will be used for Octokit authentication. Authenticating will increase the API rate limit.

Outputs

The action does not have any output.

Usage

name: Test
on:
  push:
    branches: [ master ]

jobs:
  example-job:
  runs-on: ${{ matrix.os }}

  strategy:
    matrix:
      os: [ubuntu-latest, macos-latest, windows-latest]

  steps:
    - uses: actions/checkout@v1
      name: Checkout source code

    - uses: lablabs/setup-terraform-docs@v1
      name: Setup Terraform docs
      with:
        terraform_docs_version: v0.9.1

    - shell: bash
      run: |
        terraform-docs --version

For latest release you can omit version variable and use

- uses: lablabs/setup-terraform-docs@v1

or specify it explicitly as

- uses: lablabs/setup-terraform-docs@v1
  with:
    terraform_docs_version: latest

For authenticating with the GITHUB_TOKEN you can use

- uses: lablabs/setup-terraform-docs@v1
  with:
    token: ${{ secrets.GITHUB_TOKEN }}