Skip to main content

Generate github actions documentation in markdown format.

Project description

github-actions-docs

Build Status License Latest release

Generates documentations for github actions and reusable workflows. For github actions by default the readme file would be in the same directory as the action.yaml. For reusable workflows as they all should be under .github/workflows, a single readme file will be created or the existing one will be updated for every reusable workflows under that directory.

Installation

pip install github-actions-docs

Options:

github-actions-docs --help
#positional arguments:
#  input_files_path      Path of a github action or reusable workflow file(s).
#
#options:
#  -h, --help            show this help message and exit
#  --version             show program's version number and exit
#  --verbose             More verbosity in logging. (default: False)
#  --ignore              Continue on inputs file not being a valid github action or workflow. (default: False)
#  --tag-prefix TAG_PREFIX
#                        Prefix used for the tags in the output. (default: GH_DOCS)
#  --output-mode [{replace,inject}]
#                        Method of output to file. (default: inject)
#  --docs-filename DOCS_FILENAME
#                        Creates or updates output on the same path as the input. (default: README.md)
#  --uses-ref-override USES_REF_OVERRIDE
#                        Override the uses reference in usage section. By default latest tag or current branch name will be used. (default: )

Quick start

Following command creates or updates .github/actions/example/README.md.

github-actions-docs .github/actions/example/action.yaml --verbose

If the output file (determined by --docs-filename) does not exist, it would be created based on a default template. If not it would check content of the existing file for the tags and updates them.

Full list of tags

tag name corresponding yaml path description type
<!-- GH_DOCS_NAME --> .name Name of the workflow or action both
<!-- GH_DOCS_DESCRIPTION --> .description Description of the workflow or action defaults to file path in workflows both
<!-- GH_DOCS_RUNS --> .runs only for actions Type of the action, in workflows it defaults to reusable workflow constant both
<!-- GH_DOCS_INPUTS --> .inputs for actions and .on.workflow_call.inputs for reusable workflows both
<!-- GH_DOCS_OUTPUTS --> .outputs for actions and .on.workflow_call.outputs for reusable workflows both
<!-- GH_DOCS_SECRETS --> .on.workflow_call.secrets for reusable workflows reusable workflows
<!-- GH_DOCS_TITLE --> NA Top level header for the reusable workflows, defaults to Reusable Workflows reusable workflows
<!-- GH_DOCS_CONTENTS_TABLE_TITLE --> NA Header of table of contents, defaults to List of workflows reusable workflows
<!-- GH_DOCS_CONTENTS_TABLE_ITEM --> NA Content of the table of contents, created dynamically. reusable workflows
<!-- GH_DOCS_USAGE --> NA Creates simple usage block. Check --uses-ref-override both

As a pre-commit hook

Check pre-commit for further information.

Sample .pre-commit-config.yaml

- repo: https://github.com/rzjfr/github-actions-docs
  rev: 0.2.3
  hooks:
    - id: generate-gh-actions-docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_actions_docs-0.0.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

github_actions_docs-0.0.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file github_actions_docs-0.0.1.tar.gz.

File metadata

  • Download URL: github_actions_docs-0.0.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for github_actions_docs-0.0.1.tar.gz
Algorithm Hash digest
SHA256 20c15918fa735100c0da8f7e5fe3b75ef1afb62c1127de3ea0dd4242fed1c664
MD5 7657057befbc833bfc4613fe5c349c28
BLAKE2b-256 325af87b6484c0a773ccb4a3195a1b539a5902cdc11f4afda80bd0c3f4d3e98a

See more details on using hashes here.

File details

Details for the file github_actions_docs-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github_actions_docs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8473c343f373b5dbe70530f60c83f6a37f9a1e0a13d9d35d7e59d012beed0723
MD5 718a5d0b8836dd24d91d26c7298fa28e
BLAKE2b-256 c30d8cd28cebe2b9fb9d94f96b82d1aa344b78dc3972843e9951548fcd510b2e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page