Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reakaleek/gh-action-readme
A GitHub CLI extension to generate and update GitHub Action docs
https://github.com/reakaleek/gh-action-readme
gh-extension github-actions markdown
Last synced: about 2 months ago
JSON representation
A GitHub CLI extension to generate and update GitHub Action docs
- Host: GitHub
- URL: https://github.com/reakaleek/gh-action-readme
- Owner: reakaleek
- License: mit
- Created: 2024-05-27T10:58:43.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-13T16:37:34.000Z (7 months ago)
- Last Synced: 2024-11-13T13:46:53.648Z (about 2 months ago)
- Topics: gh-extension, github-actions, markdown
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-action-readme
![GitHub Release](https://img.shields.io/github/v/release/reakaleek/gh-action-readme?logo=github)
![GitHub Release Date](https://img.shields.io/github/release-date/reakaleek/gh-action-readme?display_date=published_at&logo=github)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/reakaleek/gh-action-readme)
![GitHub License](https://img.shields.io/github/license/reakaleek/gh-action-readme)A GitHub CLI extension to inject GitHub Actions metadata into `README.md` markdown files.
> [!WARNING]
> This project is in active development and is not yet stable.## Prerequisites
- [GitHub CLI](https://cli.github.com/) installed and authenticated.## ⚡️ Quick Start
### Install the gh-action-readme extension
The `gh-action-readme` extension can be installed using the following command.
```bash
gh extension install reakaleek/gh-action-readme
```### Create a README.md file
Create a `README.md` file in the action directory containing the `action.yml` file.
You can use the following template to define the metadata placeholders.
```markdown
### Inputs
```
### Update the `README.md` file
Run the following command to update the `README.md` file with the metadata from the `action.yml` file.
```bash
gh action-readme update
```### That's it! 🎉
The `README.md` file will be updated with the metadata from the `action.yml` file.
```diff
-#
+# Awesome Action+A GitHub Action that does something awesome.
+Something that is very useful.
+## Inputs
+| Name | Description | Required | Default |
+|--------|-----------------|----------|-----------|
+| input1 | The first input | `true` | `default` |
+
```## Pre-commit (recommended)
You can also use the `gh-action-readme` extension as a [pre-commit](https://pre-commit.com/) hook to automatically update the `README.md` file before committing changes.
Add the following configuration to the `.pre-commit-config.yaml` file.
```yaml
repos:
- repo: https://github.com/reakaleek/gh-action-readme
rev: v0.4.0
hooks:
- id: action-readme
```Then run the following command to install the pre-commit hook.
```bash
pre-commit install
```> [!TIP]
> You can use the [pre-commit action](https://github.com/marketplace/actions/pre-commit) to run the pre-commit checks in your GitHub Actions workflow.### GitHub Actions Monorepo Support
The `action-readme` pre-commit supports monorepos with multiple actions in a single repository.
It will automatically detect the `action.yml` files in the repository and update the corresponding `README.md` files.```
.
├── action-a/
│ ├── action.yml
│ └── README.md
├── action-b/
│ ├── action.yml
│ └── README.md
└── some/
└── folder/
└── action-c/
├── action.yml
└── README.md
```