Skip to content

Commit 45bf746

Browse files
committed
fix(helm/generate-docs): formatting issue
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 038e134 commit 45bf746

1 file changed

Lines changed: 28 additions & 20 deletions

File tree

actions/helm/generate-docs/action.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,6 @@ runs:
7777
core.setOutput("values-file", valuesFile);
7878
}
7979
80-
// Generate markdownlint config file if not exists
81-
let markdownlintConfigPath = join(workingDirectory, ".markdownlint.json");
82-
if (!existsSync(markdownlintConfigPath)) {
83-
markdownlintConfigPath = join(process.env.RUNNER_TEMP, `${Date.now()}.markdownlint.json`);
84-
85-
const defaultConfig = {
86-
"default": true,
87-
"line-length": false
88-
};
89-
writeFileSync(markdownlintConfigPath, JSON.stringify(defaultConfig, null, 2));
90-
}
91-
core.setOutput("markdownlint-config-path", markdownlintConfigPath);
92-
9380
// Generate textlint config file if not exists
9481
let textlintConfigPath = join(workingDirectory, ".textlintrc");
9582
if (!existsSync(textlintConfigPath)) {
@@ -109,6 +96,27 @@ runs:
10996
}
11097
core.setOutput("textlint-config-path", textlintConfigPath);
11198
99+
// Generate markdownlint config file if not exists
100+
let markdownlintConfigPath = join(workingDirectory, ".markdownlint.json");
101+
if (!existsSync(markdownlintConfigPath)) {
102+
markdownlintConfigPath = join(process.env.RUNNER_TEMP, `${Date.now()}.markdownlint.json`);
103+
104+
const defaultConfig = {
105+
"default": true,
106+
"line-length": false,
107+
"outputFormatters": [
108+
[
109+
"markdownlint-cli2-formatter-template",
110+
{
111+
"template": "::${errorSeverity:${errorSeverity}}${errorSeverity!error} file=${fileName},line=${lineNumber},${columnNumber:col=${columnNumber},}title=${ruleName}::${ruleDescription}"
112+
}
113+
]
114+
]
115+
};
116+
writeFileSync(markdownlintConfigPath, JSON.stringify(defaultConfig, null, 2));
117+
}
118+
core.setOutput("markdownlint-config-path", markdownlintConfigPath);
119+
112120
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
113121

114122
- uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2
@@ -153,13 +161,6 @@ runs:
153161
CONFIG_PATH: ${{ steps.prepare-variables.outputs.textlint-config-path }}
154162
run: npx textlint --cache-location "$CACHE_PATH" --fix --config "$CONFIG_PATH" "$(pwd)/**/*.md"
155163

156-
- name: Lint Fix markdown files
157-
uses: DavidAnson/markdownlint-cli2-action@30a0e04f1870d58f8d717450cc6134995f993c63 # v21.0.0
158-
with:
159-
fix: true
160-
config: ${{ steps.prepare-variables.outputs.markdownlint-config-path }}
161-
globs: ${{ steps.prepare-variables.outputs.working-directory }}/**/*.md
162-
163164
- name: Cache prettier
164165
id: cache-prettier
165166
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
@@ -175,6 +176,13 @@ runs:
175176
VALUES_FILE: ${{ steps.prepare-variables.outputs.values-file || '' }}
176177
run: npx prettier --cache-location "$CACHE_PATH" --write "$(pwd)/**/*.md" $VALUES_FILE
177178

179+
- name: Lint Fix markdown files
180+
uses: DavidAnson/markdownlint-cli2-action@30a0e04f1870d58f8d717450cc6134995f993c63 # v21.0.0
181+
with:
182+
fix: true
183+
config: ${{ steps.prepare-variables.outputs.markdownlint-config-path }}
184+
globs: ${{ steps.prepare-variables.outputs.working-directory }}/**/*.md
185+
178186
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
179187
if: inputs.github-app-id
180188
id: generate-token

0 commit comments

Comments
 (0)