Skip to content

Commit b05f5f6

Browse files
bcaurelamannn
andauthoredApr 23, 2024··
feat: Add outputs for type, scope and subject (#261 by @bcaurel)
* Update validatePrTitle.js * Update README.md * Update README.md --------- Co-authored-by: Jan Amann <jan@amann.work>
1 parent 67cbd7a commit b05f5f6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ There are two events that can be used as triggers for this action, each with dif
166166

167167
## Outputs
168168

169-
In case the validation fails, this action will populate the `error_message` ouput.
169+
- The outputs `type`, `scope` and `subject` are populated, except for if the `wip` option is used.
170+
- The `error_message` output will be populated in case the validation fails.
170171

171172
[An output can be used in other steps](https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs), for example to comment the error message onto the pull request.
172173

@@ -222,4 +223,3 @@ jobs:
222223
```
223224
224225
</details>
225-

‎src/validatePrTitle.js

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module.exports = async function validatePrTitle(
2929
parserOpts.headerCorrespondence = headerPatternCorrespondence;
3030
}
3131
const result = parser(prTitle, parserOpts);
32+
core.setOutput('type', result.type);
33+
core.setOutput('scope', result.scope);
34+
core.setOutput('subject', result.subject);
3235

3336
function printAvailableTypes() {
3437
return `Available types:\n${types

0 commit comments

Comments
 (0)
Please sign in to comment.