Skip to content

matfax/action-docs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

action-docs

Github action that generates docs for a github action and injects them into the README.md

Usage

- name: action-docs
  uses: ${{ github.repository }}@${{ github.ref }}
  with:
    # Enable debug mode
    debug_mode: false
    # Template file to use for rendering the markdown docs
    template_file: .github/action.tpl
    # Directory that contains the action.yml and README.md
    working_dir: .

Example Workflow

name: Documentation

on:
  push:
    branches:
      - main
    paths:
      - '**.md'
      - '**.tpl'
      - '**/docs.yml'
      - '**/action.yml'
  pull_request:
    branches: [main]
    paths:
      - '**.md'
      - '**.tpl'
      - '**/docs.yml'
      - '**/action.yml'

jobs:
  update:
    name: Update
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4.2.2
        with:
          ## This head ref is required to enable pushes to pull request branches
          ref: ${{ github.head_ref || github.ref_name }}

      - name: Update Action Documentation in README
        uses: matfax/action-docs@main

      - name: Commit Changes
        if: ${{ github.event_name != 'push' }}
        uses: iarekylew00t/verified-bot-commit@v1
        with:
          files: '**/*.md'
          if-no-commit: notice
          message: |
            docs: update action documentation

            The documentation has been regenerated from the action.yml file using the configured template.

      - name: Create Pull Request
        if: ${{ github.event_name == 'push' }}
        uses: peter-evans/create-pull-request@v7.0.8
        with:
          title: 'docs: Update action documentation'
          sign-commits: true
          signoff: true
          branch: docs/update-docs
          delete-branch: true
          labels: |
            documentation
            auto-update
          commit-message: |
            docs: update action documentation

            The documentation has been regenerated from the action.yml file using the configured template.
          body: |
            This pull request contains automated updates to the action README.
            
            The documentation has been regenerated from the action.yml file using the
            configured template. Please review the changes and merge if they look correct.

            Generated by: [matfax/action-docs](https://github.com/matfax/action-docs)

Inputs

debug_mode

Required Default

Enable debug mode

template_file

Required Default

Template file to use for rendering the markdown docs

working_dir

Required Default

Directory that contains the action.yml and README.md

Outputs

num_changed

Output

Number of files changed

About

Github action that generates docs for a github action and injects them into the README.md

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 42.6%
  • Smarty 31.4%
  • Dockerfile 14.0%
  • Just 12.0%