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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
find lib
find lib
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ cd <your github action>
action-docs

# update reamde
action-ducs --update-readme
action-docs --update-readme
```

Update your README.md

```
## Add the following comment blocks to your README.md
<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->

<!-- terraform-docs-runs -->
<!-- action-docs-runs -->

## Run the cli
action-docs -u
Expand Down Expand Up @@ -56,13 +56,13 @@ Options:
Action-docs can update your README based on the `action.yml`. The following sections can be updated: description, inputs, outputs and runs. Add the following tags to your README and run `actiond-docs -u`.

```
<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->

<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
```

For updating other Markdown files add the name of the file to the command `action-docs -u <file>`.
Expand Down
12 changes: 6 additions & 6 deletions __tests__/fixtures/all_fields_readme copy 2.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- terraform-docs-description -->
<!-- action-docs-description -->
## Description

Default test


<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->
## Inputs

| parameter | description | required | default |
Expand All @@ -18,9 +18,9 @@ Default test



<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->
## Outputs

| parameter | description |
Expand All @@ -30,4 +30,4 @@ Default test



<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->
8 changes: 4 additions & 4 deletions __tests__/fixtures/all_fields_readme.input
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->

<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
16 changes: 8 additions & 8 deletions __tests__/fixtures/all_fields_readme.output
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- terraform-docs-description -->
<!-- action-docs-description -->
## Description

Default test


<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->
## Inputs

| parameter | description | required | default |
Expand All @@ -18,9 +18,9 @@ Default test



<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->
## Outputs

| parameter | description |
Expand All @@ -30,12 +30,12 @@ Default test



<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->

<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
## Runs

This action is an `node12` action.


<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
16 changes: 8 additions & 8 deletions __tests__/fixtures/all_fields_readme_filled.input
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- terraform-docs-description -->
<!-- action-docs-description -->
## Description

Default test abc


<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->
## Inputs

| parameter | description | required | default |
Expand All @@ -17,9 +17,9 @@ Default test abc



<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->
## Outputs

| parameter | description |
Expand All @@ -28,12 +28,12 @@ Default test abc



<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->

<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
## Run

This action is an `docker` action.


<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
16 changes: 8 additions & 8 deletions __tests__/fixtures/all_fields_readme_filled.output
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- terraform-docs-description -->
<!-- action-docs-description -->
## Description

Default test


<!-- terraform-docs-description -->
<!-- action-docs-description -->

<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->
## Inputs

| parameter | description | required | default |
Expand All @@ -18,9 +18,9 @@ Default test



<!-- terraform-docs-inputs -->
<!-- action-docs-inputs -->

<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->
## Outputs

| parameter | description |
Expand All @@ -30,12 +30,12 @@ Default test



<!-- terraform-docs-outputs -->
<!-- action-docs-outputs -->

<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
## Runs

This action is an `node12` action.


<!-- terraform-docs-runs -->
<!-- action-docs-runs -->
4 changes: 2 additions & 2 deletions src/terraform-docs.ts → src/action-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ async function updateReadme(
section: string
): Promise<void> {
const to = new RegExp(
`<!-- terraform-docs-${section} -->(?:(?:\n.*)+<!-- terraform-docs-${section} -->)?`
`<!-- action-docs-${section} -->(?:(?:\n.*)+<!-- action-docs-${section} -->)?`
);

await replaceInFile.replaceInFile({
files: file,
from: to,
to: `<!-- terraform-docs-${section} -->\n${text}\n<!-- terraform-docs-${section} -->`,
to: `<!-- action-docs-${section} -->\n${text}\n<!-- action-docs-${section} -->`,
});
}

Expand Down
5 changes: 0 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,3 @@ generateActionMarkdownDocs({
})
.catch((e) => console.error(e.message));
/* eslint-enable */

// if (args["update-readme"]) {
// console.log("--------ddd-");
// }
// console.log(args);
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export {
generateActionMarkdownDocs,
Options,
defaultOptions,
} from "./terraform-docs";
} from "./action-docs";