generate-md-action-inputs
Generate Markdown from Action Inputs
Section titled “Generate Markdown from Action Inputs”This GitHub Action automatically generates a Markdown table of your action’s inputs and adds it to your README.md. It’s a simple way to keep your documentation in sync with your action.yml file.
Why use this action?
Section titled “Why use this action?”- Automated Documentation: No more manually updating your
README.mdevery time you change an input in youraction.yml. - Improved Discoverability: A clear and concise table of inputs makes it easier for users to understand and use your action.
- Professional Look: A well-documented action is a sign of a quality project.
Before and After
Section titled “Before and After”Before:
<!-- ACTION start --><!-- ACTION end -->After:
<!-- ACTION start -->
| Name | Default | Description | Required || ---------- | --------------- | ------------------------- | -------- || `my-input` | `default-value` | This is my amazing input. | `false` |
<!-- ACTION end -->-
Add the comment block to your
README.md:Add the following comment block to your
README.mdwhere you want the table of inputs to be generated:<!-- ACTION start --><!-- ACTION end --> -
Create a workflow file:
Create a new workflow file in your
.github/workflowsdirectory (e.g.,.github/workflows/docs.yml) with the following content:
example-generate-md-action-inputs.yml
name: generate-md-action-inputs exampleon: workflow_dispatch:permissions: actions: write contents: writejobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - uses: stephansama/actions/generate-md-action-inputs@v1 with: verbose: trueRequired permissions
Section titled “Required permissions”permissions: actions: write contents: write🧰 actions
Section titled “🧰 actions”| 🏷️ Name | Required | ⚙️ Default | 📝 Description |
|---|---|---|---|
| comment_tag_name | comment_tag_name | ACTION | Prefix for delimiting block start and end |
| commit_message | commit_message | Updated readme with the latest action inputs | Commit message used while committing to the repo |
| committer_username | committer_username | stephansama-bot | Username used while committing to the repo |
| committer_email | committer_email | [email protected] | Email id used while committing to the repo |
| gh_token | gh_token | ${{github.token}} | Github token scoped to current repo (need to have an environment variable set if not supplied) |
| git_provider | git_provider | github | Git Provider to base remote urls from. Supported values are ‘github’ and ‘gitlab’. |
| heading | heading | ⚙️ Inputs | Heading for table |
| heading_level | heading_level | 3 | Heading level for table |
| skip_commit | skip_commit | false | Skips committing the changes to repo |
| verbose | verbose | false | Whether or not to enable verbose logging for shell scripts |
Type Aliases
Section titled “Type Aliases”| Type Alias | Description |
|---|---|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
Functions
Section titled “Functions”| Function | Description |
|---|---|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |