Skip to content

Commit 75021a0

Browse files
committed
ci: fix meson format action
fix markdown generation, use a proper list for the file entries
1 parent a82a15e commit 75021a0

File tree

1 file changed

+17
-1
lines changed
  • .github/actions/meson-format-action

1 file changed

+17
-1
lines changed

.github/actions/meson-format-action/index.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,22 @@ async function checkFile(file, formatFile) {
139139
return exitCode === 0
140140
}
141141

142+
/**
143+
*
144+
* @param {string[]} items
145+
* @param {boolean} ordered
146+
* @returns {string[]}
147+
*/
148+
function getMarkdownListOf(items, ordered) {
149+
/** @type {string[]} */
150+
const items = items.map((item) => `<li>${item}</li>`)
151+
152+
/** @type {string} */
153+
const listType = ordered ? 'ol' : 'ul'
154+
155+
return `<${listType}>${itemsContent}</${listType}>`
156+
}
157+
142158
/**
143159
* @async
144160
* @returns {Promise<void>}
@@ -221,7 +237,7 @@ async function main() {
221237
core.summary.addBreak()
222238

223239
/** @type {string} */
224-
const fileList = notFormattedFiles.map((file) => `- \`${file}\``)
240+
const fileList = getMarkdownListOf(notFormattedFiles)
225241

226242
core.summary.addDetails('Affected Files', fileList)
227243
core.summary.addSeparator()

0 commit comments

Comments
 (0)