GithubHelp home page GithubHelp logo

pndurette / gh-actions-auto-docs Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 30 KB

A GitHub Action for generating GitHub Action Markdown documentation

License: MIT License

Python 100.00%
auto-docs auto-documentation github-actions documentation-generator

gh-actions-auto-docs's Introduction

gh-actions-auto-docs

A GitHub Action for generating GitHub Action documentation—including its own!

Tests

Features

  • Generates GitHub Action documentation from the action.yml file
  • Support multi-line Markdown description yaml fields—only document your action once! (see Example)
  • Features git auto-commit to open PRs or push to branches

Setup

  1. In your README.md (or anywhere you'd like), add the template markers where you want the documentation to be inserted:
<!--doc_begin-->
<!--doc_end-->
  1. Add pndurette/gh-actions-auto-docs to a workflow, for example: (Note the requirements for allowing the workflow to push to git!)
name: Generate Action Docs

on: [pull_request]

jobs:
  doc:
    runs-on: ubuntu-latest

    permissions:
      # Required to push changes!
      contents: write

    steps:
    - uses: actions/checkout@v3
      with:
        # Required to push changes!
        ref: ${{ github.event.pull_request.head.ref }}

    - uses: pndurette/gh-actions-auto-docs@v1

Configuration

This section was automatically generated by this action from its own action.yml

Inputs

Input Description Default Required
action_yaml_file The path to the GitHub Action's action.yml file ./action.yml no
include_inputs Whenever to document the action's inputs true no
include_outputs Whenever to document the action's outputs true no
heading_size

The Markdown heading size to use for the documented
sections (i.e. number of #)

3 no
template_file The file used as template ./README.md no
target_file

The resulting file of the template substitution.
To update in-place, this can be the same as template_file.

./README.md no
marker_start

The opening marker from which the template substitution
will take place

<!--doc_begin--> no
marker_end

The closing marker to which the template substitution
will take place

<!--doc_end--> no
git_push Whenever to commit and push changes changes to target_file true no
git_push_user_name The git user name to commit with github-actions[bot] no
git_push_user_email The git user email to commit with github-actions[bot]@users.noreply.github.com no
git_commit_message The git commit message GitHub Action Auto-Docs no
git_commit_signoff Whenever to sign-off the git commit false no

Example

This action.yml ...

# [...]

inputs:
  param1:
    description: This param has some **bold** and *italics*
    required: true
    default: value1
  param2:
    description: |
      Path to some yaml:

      \```yaml
      foo: bar
      baz:
        - abc
      \```

      :warning: **Some cautionnary `tale`!**
    required: false
    default: ./some_file.yaml
  param3:
    description: See [link to somewhere](https://github.com)

outputs:
  output1:
    description: |
      A list to consider:
      1. This
      2. That
  output2:
    description: |
      Someone once said:

      > Hello, how do you do?
  output3:
    description: This is it

# [...]

... Would generate to:

Inputs

Input Description Default Required
param1

Path to some yaml:

foo: bar
baz:
- abc

⚠️ Some cautionnary tale!

./some_file.yaml no
param2 This param has some bold and italics value1 yes
param3 See link to somewhere n/a no

Outputs

Output Description
output1

A list to consider:
1. This
2. That

output2

Someone once said:

Hello, how do you do?

output3 This is it

Licence

The MIT License (MIT) Copyright © 2023-2024 Pierre Nicolas Durette

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.