Github action that generates docs for a github action and injects them into the README.md
- 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: .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)
Enable debug mode
Template file to use for rendering the markdown docs
Directory that contains the action.yml and README.md
Number of files changed