Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ jobs:
const title = context.payload.pull_request.title;
const labels = context.payload.pull_request.labels.map(l => l.name);
if (labels.includes('dev')) {
console.log('Skipping PR title check due to dev label.');
return;
}
const regex = /^(feat|fix|refactor|doc|perf|style|test|chore|revert)!?:[ ][a-z].*$/;
if (!regex.test(title)) {
core.setFailed(
`PR title "${title}" does not match the expected conventional commit format`
);
const regex = /^(?!feat|fix|refactor|doc|perf|style|test|chore|revert)[a-z].*$/;
if (!regex.test(title)) {
core.setFailed(
`PR title "${title}" does not match the commit format for non-user-facing changes`
);
}
} else {
const regex = /^(feat|fix|refactor|doc|perf|style|test|chore|revert)!?:[ ][a-z].*$/;
if (!regex.test(title)) {
core.setFailed(
`PR title "${title}" does not match the expected conventional commit format for user-facing changes`
);
}
}