Skip to content

Commit a8f444d

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

1 file changed

Lines changed: 29 additions & 20 deletions

File tree

actions/helm/generate-docs/action.yml

Lines changed: 29 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,28 @@ 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} " +
112+
"file=${fileName},line=${lineNumber},${columnNumber:col=${columnNumber},}title=${ruleName}::${ruleDescription}"
113+
}
114+
]
115+
]
116+
};
117+
writeFileSync(markdownlintConfigPath, JSON.stringify(defaultConfig, null, 2));
118+
}
119+
core.setOutput("markdownlint-config-path", markdownlintConfigPath);
120+
112121
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
113122

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

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-
163165
- name: Cache prettier
164166
id: cache-prettier
165167
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
@@ -175,6 +177,13 @@ runs:
175177
VALUES_FILE: ${{ steps.prepare-variables.outputs.values-file || '' }}
176178
run: npx prettier --cache-location "$CACHE_PATH" --write "$(pwd)/**/*.md" $VALUES_FILE
177179

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

0 commit comments

Comments
 (0)