11
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2026-04-05 00:56:54 +00:00

ci: add release job

This commit is contained in:
Wagner Santos 2020-08-21 05:48:51 -03:00
parent 1ffd33d395
commit 7ccafb1f5f
6 changed files with 1132 additions and 104 deletions

15
.github/tasks/actionYamlUpdater.js vendored Normal file
View file

@ -0,0 +1,15 @@
const yaml = require('yaml')
yaml.scalarOptions.str.fold.lineWidth = 100
const versionRegex = /\d+\.\d+\.\d+/
module.exports.readVersion = contents =>
yaml.parse(contents).runs.image.match(versionRegex)[0]
module.exports.writeVersion = (contents, version) => {
const actionFile = yaml.parse(contents)
actionFile.runs.image = actionFile.runs.image.replace(versionRegex, version)
return yaml.stringify(actionFile)
}