Skip to content

Commit a82a15e

Browse files
committed
ci: fix meson format action
fix markdown generation, make it better readable for the user
1 parent 2a53180 commit a82a15e

File tree

1 file changed

+12
-14
lines changed
  • .github/actions/meson-format-action

1 file changed

+12
-14
lines changed

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,18 @@ async function main() {
210210
true
211211
)
212212

213-
core.summary.write()
213+
core.summary.write({ overwrite: true })
214214
return
215215
}
216216

217217
core.summary.clear()
218218

219-
core.summary.addList(
220-
notFormattedFiles.map((file) => `\`${file}\``),
221-
false
222-
)
223-
224-
/** @type {string} */
225-
const fileList = core.summary.stringify()
226-
core.summary.clear()
227-
228219
core.summary.addHeading('Result', 1)
229220
core.summary.addRaw(':x: Some files are not formatted correctly', true)
221+
core.summary.addBreak()
222+
223+
/** @type {string} */
224+
const fileList = notFormattedFiles.map((file) => `- \`${file}\``)
230225

231226
core.summary.addDetails('Affected Files', fileList)
232227
core.summary.addSeparator()
@@ -235,21 +230,24 @@ async function main() {
235230
'To format the files run the following command',
236231
true
237232
)
233+
core.summary.addBreak()
238234

239235
/** @type {string} */
240-
const additionalArgs = formatFile === '' ? [] : [`-c ${formatFile}`]
236+
const additionalArgs = formatFile === '' ? [] : [`-c "${formatFile}"`]
241237

242238
/** @type {string} */
243-
const finalFileList = notFormattedFiles.join(' ')
239+
const finalFileList = notFormattedFiles
240+
.map((file) => `"${file}"`)
241+
.join(' ')
244242

245243
core.summary.addCodeBlock(
246244
`meson format ${additionalArgs} -i ${finalFileList}`,
247245
'bash'
248246
)
249247

250-
core.summary.write()
248+
core.summary.write({ overwrite: true })
251249

252-
throw new Error('Soem files are not formatted correctly')
250+
throw new Error('Some files are not formatted correctly')
253251
} catch (error) {
254252
core.setFailed(error)
255253
}

0 commit comments

Comments
 (0)