Skip to content

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

License

Notifications You must be signed in to change notification settings

mdvorak/update-action-readme

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages