Skip to content

Commit 7ca5f3f

Browse files
authored
Merge pull request #58 from ylemkimon/workflow-command
fix: do not run workflow commands in commit messages
2 parents 357a378 + d67c2ec commit 7ca5f3f

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

package-lock.json

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"conventional-changelog-lint-config-canonical": "^1.0.0",
3131
"dargs": "^7.0.0",
3232
"execa": "^4.0.3",
33-
"lerna": "^3.22.1"
33+
"lerna": "^3.22.1",
34+
"uuid": "^8.3.1"
3435
},
3536
"devDependencies": {
3637
"@commitlint/test": "^9.0.1",

src/action.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { existsSync } = require('fs')
22
const { resolve } = require('path')
3+
const { v4: uuidv4 } = require('uuid')
34
const core = require('@actions/core')
45
const github = require('@actions/github')
56
const lint = require('@commitlint/lint').default
@@ -135,13 +136,20 @@ const showLintResults = async ([from, to]) => {
135136

136137
generateOutputs(lintedCommits)
137138

139+
// disable workflow commands
140+
const token = uuidv4()
141+
console.log(`::stop-commands::${token}`)
142+
138143
if (hasOnlyWarnings(lintedCommits)) {
139144
handleOnlyWarnings(formattedResults)
140145
} else if (formattedResults) {
141146
setFailed(formattedResults)
142147
} else {
143148
console.log('Lint free! 🎉')
144149
}
150+
151+
// enable workflow commands
152+
console.log(`::${token}::`)
145153
}
146154

147155
const exitWithMessage = message => error => {

0 commit comments

Comments
 (0)