Code Monkey home page Code Monkey logo

tf-auto-document.action's Introduction

tf-auto-document.action

A GitHub action to auto generate documentation for Terraform files.

This wraps up the tf-auto-document tool here: https://github.com/richardjkendall/tf-auto-document

See example of what the documentation looks like here: https://github.com/richardjkendall/tf-modules

Requirements

Expects the target repository be structured as follows

root
 |-modules
    |-module1
    |-module2
    |-module...

The modules sub-folder can be renamed and the name of this folder can be passed into the action using the modulesFolder input variable.

For more info about the tool and how it works, look here https://github.com/richardjkendall/tf-auto-document

Special Git Requirements

Normally when you use the action/checkout action in a workflow it does a shallow clone of the your repository and does not pull any tags down. The full history and tags are needed so that the tool can find the releases to include in the documentation.

To do this there are two steps needed:

  1. on the checkout action add
with:
  fetch-depth: 0
  1. add a step right after the checkout action which pulls down the tags
- name: get all tags
  run: git fetch origin +refs/tags/*:refs/tags/*

Example

name: build docs
on:
  push:
    branches: [ master ]
    paths:
      - '**.tf'

jobs:
  build:
    name: build docs
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 0
    - name: get all tags
      run: git fetch origin +refs/tags/*:refs/tags/*
    - name: build docs
      uses: richardjkendall/[email protected]
      with:
        modulesFolder: 'modules'
    - name: commit doc changes
      run : |
        git_hash=$(git rev-parse --short "$GITHUB_SHA")
        git add **/*.md
        git config user.email <email address>
        git config user.name "Robot"
        git commit -m "docs for commit $git_hash"
        git push

tf-auto-document.action's People

Contributors

richardjkendall avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.