Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tj-actions/auto-doc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.1
Choose a base ref
...
head repository: tj-actions/auto-doc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.7.0
Choose a head ref
  • 7 commits
  • 16 files changed
  • 5 contributors

Commits on Jun 6, 2023

  1. Merge pull request #484 from tj-actions/upgrade-to-v2.6.1

    Upgraded to v2.6.1
    repo-ranger[bot] authored Jun 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1b233f2 View commit details
  2. Update README.md

    jackton1 authored Jun 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5a8d1f8 View commit details

Commits on Jun 7, 2023

  1. feat: Add a new input to optionally set names as markdown anchors (#480)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    Co-authored-by: Tonye Jack <jtonye@ymail.com>
    3 people authored Jun 7, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b750d7a View commit details
  2. Copy the full SHA
    6b78036 View commit details
  3. Updated README.md

    jackton1 committed Jun 7, 2023
    Copy the full SHA
    c9b3014 View commit details
  4. chore: improve code coverage (#485)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    jackton1 and github-actions[bot] authored Jun 7, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    33205a6 View commit details
  5. Copy the full SHA
    2a18124 View commit details
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@ on:
branches:
- main

permissions:
contents: write

jobs:
snapshot:
name: snapshot
22 changes: 22 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

# [2.7.0](https://github.com/tj-actions/auto-doc/compare/v2.6.1...v2.7.0) - (2023-06-07)

## <!-- 0 -->🚀 Features

- Add a new input to optionally set names as markdown anchors ([#480](https://github.com/tj-actions/auto-doc/issues/480)) ([b750d7a](https://github.com/tj-actions/auto-doc/commit/b750d7a55150cf63905fd20747da03323c6a41fc)) - (Viacheslav Kudinov)

## <!-- 26 -->🔄 Update

- Updated README.md
([c9b3014](https://github.com/tj-actions/auto-doc/commit/c9b30141364dde6527a5ba828d6abea05bc00a5d)) - (Tonye Jack)
- Update README.md ([5a8d1f8](https://github.com/tj-actions/auto-doc/commit/5a8d1f80ef72171af12584dd08ef58efd76e246e)) - (Tonye Jack)

## <!-- 30 -->📝 Other

- PR [#484](https://github.com/tj-actions/auto-doc/pull/484): to v2.6.1 ([1b233f2](https://github.com/tj-actions/auto-doc/commit/1b233f2e70a16ad49511ba09e2d7bb2ba18475bc)) - (repo-ranger[bot])

## <!-- 7 -->⚙️ Miscellaneous Tasks

- Improve code coverage ([#485](https://github.com/tj-actions/auto-doc/issues/485)) ([33205a6](https://github.com/tj-actions/auto-doc/commit/33205a6530e0fd158dcd95b4f8b18b6ec62c81fb)) - (Tonye Jack)
- Updated coverage badge. ([6b78036](https://github.com/tj-actions/auto-doc/commit/6b78036deb9beb6937bf15318e8d83049190c5c3)) - (GitHub Action)

# [2.6.1](https://github.com/tj-actions/auto-doc/compare/v2.6.0...v2.6.1) - (2023-06-06)

## <!-- 25 -->🎨 Format
@@ -22,6 +43,7 @@

## <!-- 7 -->⚙️ Miscellaneous Tasks

- Upgraded from v2.6.0 -> v2.6.1 ([e332e0a](https://github.com/tj-actions/auto-doc/commit/e332e0a5dd5d2243c968292decde099c321bb953)) - (github-actions[bot])
- Update formatting ([757551c](https://github.com/tj-actions/auto-doc/commit/757551c3ea61196541919b81c5ad5b2612a6412c)) - (Tonye Jack)

# [2.6.0](https://github.com/tj-actions/auto-doc/compare/v2.5.4...v2.6.0) - (2023-06-06)
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
[![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\&logo=windows\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
[![Public workflows that use this action.](https://img.shields.io/endpoint?style=for-the-badge\&url=https%3A%2F%2Fused-by.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fauto-doc%26badge%3Dtrue%26package_id%3DUGFja2FnZS0yOTU3MDU0NDI1)](https://github.com/search?o=desc\&q=tj-actions+auto-doc+language%3AYAML\&s=\&type=Code)

![Coverage](https://img.shields.io/badge/Coverage-80.6%25-brightgreen)
![Coverage](https://img.shields.io/badge/Coverage-88.6%25-brightgreen)
[![codecov](https://codecov.io/github/tj-actions/auto-doc/branch/main/graph/badge.svg?token=TNXW4QRRJD)](https://codecov.io/github/tj-actions/auto-doc)
[![Go Reference](https://pkg.go.dev/badge/github.com/tj-actions/auto-doc/v2.svg)](https://pkg.go.dev/github.com/tj-actions/auto-doc/v2)
[![Go Report Card](https://goreportcard.com/badge/github.com/tj-actions/auto-doc)](https://goreportcard.com/report/github.com/tj-actions/auto-doc)
@@ -26,6 +26,7 @@ GitHub Action that generates beautiful, easy-to-read markdown tables with just a
* Document your custom [Github action](https://docs.github.com/en/actions/creating-actions) using the `action.yml` file.
* Document [reusable workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows) by specifying the filename.
* Easy to understand markdown table of all inputs, outputs, secrets.
* Show deprecated inputs.
* Fast and always up-to-date documentation.

## Table of Contents
@@ -67,6 +68,7 @@ Add the `Inputs` and/or `Outputs` and/or `Secrets` (only supported by reusable w
| col\_max\_words | string | false | `"5"` | Max number of words per line <br>in a column |
| filename | string | false | `"action.yml"` | Path to the yaml file |
| input\_columns | string | false | | List of action.yml **input** columns names <br>to display, default (display all columns) |
| markdown\_links | string | false | `"false"` | Boolean indicating whether to output input, <br>output and secret names as markdown <br>links |
| output | string | false | `"README.md"` | Path to the output file |
| output\_columns | string | false | | List of action.yml **output** column names <br>to display, default (display all columns) |
| reusable | string | false | | Boolean Indicating whether the file is <br>a reusable workflow |
@@ -156,6 +158,7 @@ Automatically generate documentation for your custom github action or reusable w
-f, --filename string config file
-h, --help help for auto-doc
--inputColumns stringArray list of input column names (default [Input,Type,Required,Default,Description])
-m, --markdownLinks Names of inputs, outputs and secrets as markdown links
-o, --output string Output file (default "README.md")
--outputColumns stringArray list of output column names (default [Output,Type,Description])
-r, --reusable A reusable workflow
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -42,6 +42,10 @@ inputs:
version:
description: 'The version number to run'
required: false
markdown_links:
description: 'Boolean indicating whether to output input, output and secret names as markdown links'
required: false
default: 'false'

runs:
using: 'composite'
@@ -52,7 +56,7 @@ runs:
with:
repository-owner: tj-actions
repository: auto-doc
version: v2.6.1
version: v2.7.0
language-type: 'go'
- run: |
bash $GITHUB_ACTION_PATH/entrypoint.sh
@@ -73,6 +77,7 @@ runs:
INPUT_REUSABLE_SECRET_COLUMNS: ${{ inputs.reusable_secret_columns }}
INPUT_REUSABLE: ${{ inputs.reusable }}
INPUT_VERSION: ${{ inputs.version }}
INPUT_MARKDOWN_LINKS: ${{ inputs.markdown_links }}
branding:
icon: file-text
42 changes: 29 additions & 13 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -59,7 +59,13 @@ func RootCmdRunE(cmd *cobra.Command, args []string) error {
}

reusable, err := cmd.Flags().GetBool("reusable")
// coverage:ignore
if err != nil {
return err
}

markdownLinks, err := cmd.Flags().GetBool("markdownLinks")
// coverage:ignore
if err != nil {
return err
}
@@ -68,22 +74,24 @@ func RootCmdRunE(cmd *cobra.Command, args []string) error {

if reusable {
documentation = &types.Reusable{
InputFileName: fileName,
OutputFileName: outputFileName,
ColMaxWidth: colMaxWidth,
ColMaxWords: colMaxWords,
InputColumns: reusableInputColumns,
OutputColumns: reusableOutputColumns,
SecretColumns: reusableSecretColumns,
InputFileName: fileName,
OutputFileName: outputFileName,
ColMaxWidth: colMaxWidth,
ColMaxWords: colMaxWords,
InputColumns: reusableInputColumns,
OutputColumns: reusableOutputColumns,
SecretColumns: reusableSecretColumns,
InputMarkdownLinks: markdownLinks,
}
} else {
documentation = &types.Action{
InputFileName: fileName,
OutputFileName: outputFileName,
ColMaxWidth: colMaxWidth,
ColMaxWords: colMaxWords,
InputColumns: inputColumns,
OutputColumns: outputColumns,
InputFileName: fileName,
OutputFileName: outputFileName,
ColMaxWidth: colMaxWidth,
ColMaxWords: colMaxWords,
InputColumns: inputColumns,
OutputColumns: outputColumns,
InputMarkdownLinks: markdownLinks,
}
}

@@ -93,6 +101,7 @@ func RootCmdRunE(cmd *cobra.Command, args []string) error {
}

err = documentation.RenderOutput()
// coverage:ignore
if err != nil {
return err
}
@@ -107,6 +116,7 @@ func RootCmdRunE(cmd *cobra.Command, args []string) error {

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
// coverage:ignore
func Execute() {
cobra.CheckErr(rootCmd.Execute())
}
@@ -176,6 +186,12 @@ func RootCmdFlags(cmd *cobra.Command) {
internal.DefaultReusableSecretColumns,
"list of reusable secrets column names",
)
cmd.Flags().BoolP(
"markdownLinks",
"m",
false,
"Names of inputs, outputs and secrets as markdown links",
)
}

func init() {
Loading