Skip to content
align-justify

GitHub Action

Update Action README

v1.2.0 Latest version

Update Action README

align-justify

Update Action README

Renders Markdown tables for inputs and outputs from action.yaml file

Installation

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

              

- name: Update Action README

uses: mdvorak/update-action-readme@v1.2.0

Learn more about this action in mdvorak/update-action-readme

Choose a version

Test ShellCheck

Update README Inputs/Outputs Action

Renders Markdown tables for inputs and outputs from actions.yml file.

Usage

Add following lines to Markdown file:

<!--(inputs-start)-->
<!--(inputs-end)-->

<!--(outputs-start)-->
<!--(outputs-end)-->

This action will always replace contents between start/end tags. Only one pair might be used.

The script update_readme.sh is also usable on its own:

update_readme.sh [target file = README.md] [action definition = action.yml]

Example Workflow

name: Update README.md
on:
  push:
    branches: [ "**" ]
    paths:
      - action.yml
  workflow_dispatch:

jobs:
  generate:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Update README.md
        uses: mdvorak/update-action-readme@v1

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v4
        with:
          title: "docs(readme): update README.md tables on ${{ github.ref_name }}"
          commit-message: "docs(readme): updated README.md inputs table"
          body: "Updated README.md inputs/outputs tables, according to action.yml file"
          branch: update-readme--${{ github.ref_name }}
          delete-branch: true
          labels: bot,documentation

Inputs

Name Required Default Description
file true README.md Path of the updated Markdown file.
action-file false Path of action.yml file.

Requirements

Action internally uses sed, awk and yq.