mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 08:06:54 +00:00
BREAKING CHANGE: `commitlint.config.js` is not supported anymore, please use `.mjs` extension
24 lines
539 B
JavaScript
24 lines
539 B
JavaScript
import { setOutput } from '@actions/core'
|
|
|
|
const resultsOutputId = 'results'
|
|
|
|
const mapMessageValidation = (item) => item.message
|
|
|
|
const mapResultOutput = ({
|
|
hash,
|
|
lintResult: { valid, errors, warnings, input },
|
|
}) => ({
|
|
hash,
|
|
message: input,
|
|
valid,
|
|
errors: errors.map(mapMessageValidation),
|
|
warnings: warnings.map(mapMessageValidation),
|
|
})
|
|
|
|
const generateOutputs = (lintedCommits) => {
|
|
const resultsOutput = lintedCommits.map(mapResultOutput)
|
|
|
|
setOutput(resultsOutputId, resultsOutput)
|
|
}
|
|
|
|
export default generateOutputs
|