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.5.4
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.6.0
Choose a head ref
  • 5 commits
  • 15 files changed
  • 4 contributors

Commits on May 12, 2023

  1. Merge pull request #477 from tj-actions/upgrade-to-v2.5.4

    Upgraded to v2.5.4
    repo-ranger[bot] authored May 12, 2023

    Verified

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

Commits on May 15, 2023

  1. Copy the full SHA
    fe77e45 View commit details

Commits on May 27, 2023

  1. Update README.md

    jackton1 authored May 27, 2023

    Verified

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

Commits on Jun 6, 2023

  1. feat: add support for indicating deprecated inputs (#481)

    * feat: add support for indicating deprecated inputs
    
    * Formatted code.
    
    ---------
    
    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    jackton1 and github-actions[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
    1034c3e View commit details
  2. Copy the full SHA
    24706b6 View commit details
2 changes: 1 addition & 1 deletion .github/workflows/sync-release-version.yml
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ jobs:

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6
uses: tj-actions/branch-names@v7

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v14
22 changes: 22 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

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

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

- Add support for indicating deprecated inputs ([#481](https://github.com/tj-actions/auto-doc/issues/481)) ([1034c3e](https://github.com/tj-actions/auto-doc/commit/1034c3e0222de0e0f7b07a3cb37c87757bdc4631)) - (Tonye Jack)

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

- Update README.md ([7aae7c3](https://github.com/tj-actions/auto-doc/commit/7aae7c39efa57b5c5a7c105733c3459838b2e191)) - (Tonye Jack)

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

- PR [#477](https://github.com/tj-actions/auto-doc/pull/477): to v2.5.4 ([8d294a2](https://github.com/tj-actions/auto-doc/commit/8d294a22ce090ec6fec7ec19a17ef8c6cbb3276a)) - (repo-ranger[bot])

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

- **deps:** Update tj-actions/branch-names action to v7 ([fe77e45](https://github.com/tj-actions/auto-doc/commit/fe77e45b4b325230d9ca37002ded009bf3127e7c)) - (renovate[bot])

# [2.5.4](https://github.com/tj-actions/auto-doc/compare/v2.5.3...v2.5.4) - (2023-05-12)

## <!-- 26 -->🔄 Update
@@ -10,6 +28,10 @@

- PR [#476](https://github.com/tj-actions/auto-doc/pull/476): to v2.5.3 ([ea29a7f](https://github.com/tj-actions/auto-doc/commit/ea29a7f1fc2974b5765bcc856e9348a86cd84458)) - (repo-ranger[bot])

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

- Upgraded from v2.5.3 -> v2.5.4 ([f5d2fe1](https://github.com/tj-actions/auto-doc/commit/f5d2fe14eeb47c2d25098a7863fe47929be76a3d)) - (github-actions[bot])

# [2.5.3](https://github.com/tj-actions/auto-doc/compare/v2.5.0...v2.5.3) - (2023-05-12)

## <!-- 0 -->🚀 Features
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge\&logo=ubuntu\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
[![Mac OS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\&logo=macos\&logoColor=F0F0F0)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
[![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)](https://github.com/search?o=desc\&q=tj-actions+auto-doc+language%3AYAML\&s=\&type=Code)
[![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)
[![codecov](https://codecov.io/github/tj-actions/auto-doc/branch/main/graph/badge.svg?token=TNXW4QRRJD)](https://codecov.io/github/tj-actions/auto-doc)
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ runs:
with:
repository-owner: tj-actions
repository: auto-doc
version: v2.5.4
version: v2.6.0
language-type: 'go'
- run: |
bash $GITHUB_ACTION_PATH/entrypoint.sh
45 changes: 27 additions & 18 deletions internal/types/action.go
Original file line number Diff line number Diff line change
@@ -35,9 +35,10 @@ import (

// ActionInput represents the input of the action.yml
type ActionInput struct {
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default,omitempty"`
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default,omitempty"`
DeprecationMessage string `yaml:"deprecationMessage,omitempty"`
}

// ActionOutput represents the output of the action.yml
@@ -160,10 +161,10 @@ func (a *Action) RenderOutput() error {
}

// renderActionOutputTableOutput renders the action input table
func renderActionInputTableOutput(i map[string]ActionInput, inputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
func renderActionInputTableOutput(inputs map[string]ActionInput, inputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
inputTableOutput := &strings.Builder{}

if len(i) > 0 {
if len(inputs) > 0 {
_, err := fmt.Fprintln(inputTableOutput, internal.InputAutoDocStart)
if err != nil {
return inputTableOutput, err
@@ -175,8 +176,8 @@ func renderActionInputTableOutput(i map[string]ActionInput, inputColumns []strin
inputTable.SetCenterSeparator(internal.PipeSeparator)
inputTable.SetAlignment(tablewriter.ALIGN_CENTER)

keys := make([]string, 0, len(i))
for k := range i {
keys := make([]string, 0, len(inputs))
for k := range inputs {
keys = append(keys, k)
}
sort.Strings(keys)
@@ -189,18 +190,26 @@ func renderActionInputTableOutput(i map[string]ActionInput, inputColumns []strin
for _, col := range inputColumns {
switch col {
case "Input":
row = append(row, key)
if inputs[key].DeprecationMessage != "" {
row = append(row, fmt.Sprintf("~~%s~~ <br> **%s**", key, inputs[key].DeprecationMessage))
} else {
row = append(row, key)
}
case "Type":
row = append(row, "string")
case "Required":
row = append(row, strconv.FormatBool(i[key].Required))
row = append(row, strconv.FormatBool(inputs[key].Required))
case "Default":
row = append(row, utils.FormatValue(i[key].Default))
row = append(row, utils.FormatValue(inputs[key].Default))
case "Description":
row = append(row, utils.WordWrap(i[key].Description, maxWords))
if inputs[key].DeprecationMessage != "" {
row = append(row, utils.WordWrap(fmt.Sprintf("**Deprecated:** %s", inputs[key].Description), maxWords))
} else {
row = append(row, utils.WordWrap(inputs[key].Description, maxWords))
}
default:
return inputTableOutput, fmt.Errorf(
"unknown input column: '%s'. Please specify any of the following columns: %s",
"unknown inputs column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(internal.DefaultActionInputColumns, ", "),
)
@@ -230,10 +239,10 @@ func renderActionInputTableOutput(i map[string]ActionInput, inputColumns []strin
}

// renderActionOutputTableOutput renders the action output table
func renderActionOutputTableOutput(o map[string]ActionOutput, outputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
func renderActionOutputTableOutput(outputs map[string]ActionOutput, outputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
outputTableOutput := &strings.Builder{}

if len(o) > 0 {
if len(outputs) > 0 {
_, err := fmt.Fprintln(outputTableOutput, internal.OutputAutoDocStart)
if err != nil {
return outputTableOutput, err
@@ -245,8 +254,8 @@ func renderActionOutputTableOutput(o map[string]ActionOutput, outputColumns []st
outputTable.SetCenterSeparator(internal.PipeSeparator)
outputTable.SetAlignment(tablewriter.ALIGN_CENTER)

keys := make([]string, 0, len(o))
for k := range o {
keys := make([]string, 0, len(outputs))
for k := range outputs {
keys = append(keys, k)
}
sort.Strings(keys)
@@ -262,10 +271,10 @@ func renderActionOutputTableOutput(o map[string]ActionOutput, outputColumns []st
case "Type":
row = append(row, "string")
case "Description":
row = append(row, utils.WordWrap(o[key].Description, maxWords))
row = append(row, utils.WordWrap(outputs[key].Description, maxWords))
default:
return outputTableOutput, fmt.Errorf(
"unknown output column: '%s'. Please specify any of the following columns: %s",
"unknown outputs column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(internal.DefaultActionOutputColumns, ", "),
)
69 changes: 39 additions & 30 deletions internal/types/reusable.go
Original file line number Diff line number Diff line change
@@ -35,10 +35,11 @@ import (

// ReusableInput represents the input of the reusable workflow
type ReusableInput struct {
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default,omitempty"`
Type string `yaml:"type"`
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default,omitempty"`
Type string `yaml:"type"`
DeprecationMessage string `yaml:"deprecationMessage,omitempty"`
}

// ReusableOutput represents the output of the reusable workflow
@@ -197,10 +198,10 @@ func (r *Reusable) RenderOutput() error {
}

// renderReusableInputTableOutput renders the reusable workflow input table
func renderReusableInputTableOutput(i map[string]ReusableInput, inputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
func renderReusableInputTableOutput(inputs map[string]ReusableInput, inputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
inputTableOutput := &strings.Builder{}

if len(i) > 0 {
if len(inputs) > 0 {
_, err := fmt.Fprintln(inputTableOutput, internal.InputAutoDocStart)
if err != nil {
return inputTableOutput, err
@@ -212,8 +213,8 @@ func renderReusableInputTableOutput(i map[string]ReusableInput, inputColumns []s
inputTable.SetCenterSeparator(internal.PipeSeparator)
inputTable.SetAlignment(tablewriter.ALIGN_CENTER)

keys := make([]string, 0, len(i))
for k := range i {
keys := make([]string, 0, len(inputs))
for k := range inputs {
keys = append(keys, k)
}
sort.Strings(keys)
@@ -226,23 +227,31 @@ func renderReusableInputTableOutput(i map[string]ReusableInput, inputColumns []s
for _, col := range inputColumns {
switch col {
case "Input":
row = append(row, key)
if inputs[key].DeprecationMessage != "" {
row = append(row, fmt.Sprintf("~~%s~~ <br> **%s**", key, inputs[key].DeprecationMessage))
} else {
row = append(row, key)
}
case "Type":
row = append(row, i[key].Type)
row = append(row, inputs[key].Type)
case "Required":
row = append(row, strconv.FormatBool(i[key].Required))
row = append(row, strconv.FormatBool(inputs[key].Required))
case "Default":
switch i[key].Type {
switch inputs[key].Type {
case "string":
row = append(row, utils.FormatValue(i[key].Default))
row = append(row, utils.FormatValue(inputs[key].Default))
default:
row = append(row, "`"+i[key].Default+"`")
row = append(row, "`"+inputs[key].Default+"`")
}
case "Description":
row = append(row, utils.WordWrap(i[key].Description, maxWords))
if inputs[key].DeprecationMessage != "" {
row = append(row, utils.WordWrap(fmt.Sprintf("**Deprecated:** %s", inputs[key].Description), maxWords))
} else {
row = append(row, utils.WordWrap(inputs[key].Description, maxWords))
}
default:
return inputTableOutput, fmt.Errorf(
"unknown input column: '%s'. Please specify any of the following columns: %s",
"unknown inputs column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(internal.DefaultReusableInputColumns, ", "),
)
@@ -272,10 +281,10 @@ func renderReusableInputTableOutput(i map[string]ReusableInput, inputColumns []s
}

// renderReusableOutputTableOutput renders the reusable workflow output table
func renderReusableOutputTableOutput(o map[string]ReusableOutput, reusableOutputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
func renderReusableOutputTableOutput(outputs map[string]ReusableOutput, reusableOutputColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
outputTableOutput := &strings.Builder{}

if len(o) > 0 {
if len(outputs) > 0 {
_, err := fmt.Fprintln(outputTableOutput, internal.OutputAutoDocStart)
if err != nil {
return outputTableOutput, err
@@ -287,8 +296,8 @@ func renderReusableOutputTableOutput(o map[string]ReusableOutput, reusableOutput
outputTable.SetCenterSeparator(internal.PipeSeparator)
outputTable.SetAlignment(tablewriter.ALIGN_CENTER)

keys := make([]string, 0, len(o))
for k := range o {
keys := make([]string, 0, len(outputs))
for k := range outputs {
keys = append(keys, k)
}
sort.Strings(keys)
@@ -302,12 +311,12 @@ func renderReusableOutputTableOutput(o map[string]ReusableOutput, reusableOutput
case "Output":
row = append(row, key)
case "Value":
row = append(row, utils.FormatValue(o[key].Value))
row = append(row, utils.FormatValue(outputs[key].Value))
case "Description":
row = append(row, utils.WordWrap(o[key].Description, maxWords))
row = append(row, utils.WordWrap(outputs[key].Description, maxWords))
default:
return outputTableOutput, fmt.Errorf(
"unknown output column: '%s'. Please specify any of the following columns: %s",
"unknown outputs column: '%s'. Please specify any of the following columns: %s",
col,
strings.Join(internal.DefaultReusableOutputColumns, ", "),
)
@@ -336,10 +345,10 @@ func renderReusableOutputTableOutput(o map[string]ReusableOutput, reusableOutput
}

// renderReusableSecretTableOutput renders the reusable workflow secret table
func renderReusableSecretTableOutput(s map[string]ReusableSecret, secretColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
func renderReusableSecretTableOutput(secrets map[string]ReusableSecret, secretColumns []string, maxWidth int, maxWords int) (*strings.Builder, error) {
secretTableOutput := &strings.Builder{}

if len(s) > 0 {
if len(secrets) > 0 {
_, err := fmt.Fprintln(secretTableOutput, internal.SecretsAutoDocStart)
if err != nil {
return secretTableOutput, err
@@ -351,8 +360,8 @@ func renderReusableSecretTableOutput(s map[string]ReusableSecret, secretColumns
secretTable.SetCenterSeparator(internal.PipeSeparator)
secretTable.SetAlignment(tablewriter.ALIGN_CENTER)

keys := make([]string, 0, len(s))
for k := range s {
keys := make([]string, 0, len(secrets))
for k := range secrets {
keys = append(keys, k)
}
sort.Strings(keys)
@@ -366,12 +375,12 @@ func renderReusableSecretTableOutput(s map[string]ReusableSecret, secretColumns
case "Secret":
row = append(row, key)
case "Required":
row = append(row, fmt.Sprintf("%v", s[key].Required))
row = append(row, fmt.Sprintf("%v", secrets[key].Required))
case "Description":
row = append(row, utils.WordWrap(s[key].Description, maxWords))
row = append(row, utils.WordWrap(secrets[key].Description, maxWords))
default:
return secretTableOutput, fmt.Errorf(
"unknown secrets column: '%s'. Please specify any of the following columns: %s",
"unknown secrets column: '%secrets'. Please specify any of the following columns: %secrets",
col,
strings.Join(internal.DefaultReusableSecretColumns, ", "),
)
Loading