Skip to content

Commit 58072cd

Browse files
authored
Merge pull request #71 from wagoid/fix/remove-outputs-generation
fix: remove command executions
2 parents 1788ebd + b674cd3 commit 58072cd

File tree

5 files changed

+37
-168
lines changed

5 files changed

+37
-168
lines changed

.github/workflows/commitlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- uses: actions/checkout@v2
99
with:
1010
fetch-depth: 0
11-
- run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml
11+
- run: sed -i -E "s/(docker:.+)/Dockerfile/" ./action.yml
1212
- run: echo -n '' > .dockerignore
1313
- uses: ./
1414
id: run_commitlint
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v2
2222
with:
2323
fetch-depth: 0
24-
- run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml
24+
- run: sed -i -E "s/(docker:.+)/Dockerfile/" ./action.yml
2525
- run: echo -n '' > .dockerignore
2626
- uses: ./
2727
with:

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ You can see more info about GitHub's default token [here](https://docs.github.co
6262

6363
default: `${{ github.token }}`
6464

65-
## Outputs
66-
67-
### `results`
68-
69-
The error and warning messages for each one of the analyzed commits. This is useful if you want to use the commitlint results in a JSON format in other jobs. See [the documentation](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson) on how to read JSON information from outputs.
70-
71-
Below you can see an example text output together with its corresponding JSON output:
72-
7365
```
7466
You have commit messages with errors
7567

src/action.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const lint = require('@commitlint/lint').default
77
const { format } = require('@commitlint/format')
88
const load = require('@commitlint/load').default
99
const gitCommits = require('./gitCommits')
10-
const generateOutputs = require('./generateOutputs')
1110

1211
const pullRequestEvent = 'pull_request'
1312

@@ -109,7 +108,9 @@ const hasOnlyWarnings = lintedCommits =>
109108
lintedCommits.some(({ lintResult }) => lintResult.warnings.length)
110109

111110
const setFailed = formattedResults => {
112-
core.setFailed(`You have commit messages with errors\n\n${formattedResults}`)
111+
process.exitCode = 1
112+
113+
console.error(`You have commit messages with errors\n\n${formattedResults}`)
113114
}
114115

115116
const handleOnlyWarnings = formattedResults => {
@@ -134,8 +135,6 @@ const showLintResults = async ([from, to]) => {
134135
)
135136
const formattedResults = formatErrors(lintedCommits)
136137

137-
generateOutputs(lintedCommits)
138-
139138
// disable workflow commands
140139
const token = uuidv4()
141140
console.log(`::stop-commands::${token}`)
@@ -153,7 +152,9 @@ const showLintResults = async ([from, to]) => {
153152
}
154153

155154
const exitWithMessage = message => error => {
156-
core.setFailed(`${message}\n${error.message}\n${error.stack}`)
155+
process.exitCode = 1
156+
157+
console.error(`${message}\n${error.message}\n${error.stack}`)
157158
}
158159

159160
const commitLinterAction = () =>

0 commit comments

Comments
 (0)