Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# GitHub Action Document Writer

Creates a README for GitHub actions from an `action.yml` file.
Provides an opinionated command line application to generated READMEs for
[GitHub Actions] and [GitHub Workflows].

## Usage

### Documenting GitHub Actions

```
$ github-action-doc action -h
Generate documentation for a Github action

USAGE:
github-action-doc action <ACTION_FILE>

ARGS:
<ACTION_FILE>

OPTIONS:
-h, --help Print help information

```

### Documenting GitHub Workflows

```
$ github-action-doc workflow -h
Generate documentation for a Github workflow

USAGE:
github-action-doc workflow <WORKFLOW_FILE>

ARGS:
<WORKFLOW_FILE>

OPTIONS:
-h, --help Print help information
```

## Examples

### Actions

* [`actions/checkout@v3`](https://gist.github.com/foo4u/3935d6d9b41fe92b19077515c7a035e5#file-checkout_readme-md)
* [`actions/setup-java@v3`](https://gist.github.com/foo4u/3935d6d9b41fe92b19077515c7a035e5#file-setup_java_jdk_readme-md)

[GitHub Actions]: https://docs.github.com/en/actions/learn-github-actions/essential-features-of-github-actions
[GitHub Workflows]: https://github.com/features/actions
4 changes: 3 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clap::{Subcommand};
use clap::Parser;

#[derive(Debug, Parser)]
#[clap(name = "github_action_doc")]
#[clap(name = "github-action-doc")]
#[clap(about = "A GitHub action & workflow readme writer", long_about = None)]
pub struct Cli {
#[clap(subcommand)]
Expand All @@ -17,6 +17,8 @@ pub enum Commands {
#[clap(required = true, value_parser)]
action_file: String
},
#[clap(arg_required_else_help = true)]
#[clap(about = "Generate documentation for a Github workflow", long_about = None)]
Workflow {
#[clap(required = true, value_parser)]
workflow_file: String
Expand Down