mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
As mentioned on https://github.com/actions/toolkit/issues/702#issuecomment-774269650, we are safe to execute commands on our side. This reverts commit58072cd806, reversing changes made to1788ebdc06.
24 lines
538 B
JavaScript
24 lines
538 B
JavaScript
const core = require('@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)
|
|
|
|
core.setOutput(resultsOutputId, resultsOutput)
|
|
}
|
|
|
|
module.exports = generateOutputs
|