Skip to content
play

GitHub Action

ansdoc

v1.2.0 Latest version

ansdoc

play

ansdoc

Generate Markdown Table docs for your Ansible Role

Installation

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

              

- name: ansdoc

uses: FalcoSuessgott/ansdoc-action@v1.2.0

Learn more about this action in FalcoSuessgott/ansdoc-action

Choose a version

ansdoc action

Github Action running ansdoc

Usage

name: ansdoc

on:
  # run this action only on master/main branch, so the README.md gets updated
  # after every successful merge from a feature branch
  push:
    branches:
      - 'main'
      - 'master'

jobs:
  ansdoc:
    name: ansdoc

    # required to commit the specified output file back to the branch
    permissions:
      contents: write

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: FalcoSuessgott/ansdoc-action@v1
        with:
            # file containting the ansible variables (default: defaults/main.yml)
            # the file needs to contain two "<!--ansdoc -->" seperators!
            vars-file: defaults/main.yml
            # specifiy the output file (default: README.md)
            output-file:  README.md

        # this step commits the output-file back to the repo. Check: https://github.com/stefanzweifel/git-auto-commit-action
      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "docs(vars): update documentation generated by ansdoc"

Notable Projects that use this action: