diff options
Diffstat (limited to 'javascript/videojs/.github/actions/pr-titles.mjs')
| -rw-r--r-- | javascript/videojs/.github/actions/pr-titles.mjs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/javascript/videojs/.github/actions/pr-titles.mjs b/javascript/videojs/.github/actions/pr-titles.mjs new file mode 100644 index 0000000..6712d48 --- /dev/null +++ b/javascript/videojs/.github/actions/pr-titles.mjs @@ -0,0 +1,13 @@ +import * as core from '@actions/core'; +import * as github from '@actions/github'; + +(async function run() { + const title = github.context.payload.pull_request?.title; + const titleRegex = /^(chore|ci|docs|feat|fix|refactor|revert|test)(\(.+\))?!?: (.+)/; + + if (!!title.match(titleRegex)) { + core.info('Pull request title is OK'); + } else { + core.setFailed('Please use conventional commit style for the PR title so the merged change appears in the changelog. See https://www.conventionalcommits.org/.'); + } +})(); |
