Skip to content

🧹 infra: cleanup unity package structure and update gitignore #32

🧹 infra: cleanup unity package structure and update gitignore

🧹 infra: cleanup unity package structure and update gitignore #32

Workflow file for this run

name: PR Title Check
on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
jobs:
validate-title:
name: Validate PR Title
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Check title format
uses: actions/github-script@v7
with:
script: |
const title = context.payload.pull_request.title;
const parts = title.split(' ');
if (parts.length < 3) {
core.setFailed(`Pull request title '${title}' does not match ':gitmoji: scope: summary' format.`);
return;
}
const prefix = parts[0];
const rest = title.slice(prefix.length + 1);
const scopePattern = /^[A-Za-z-]+: [A-Za-z0-9 ,'-]+$/;
const emojiPattern = /^[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u;
const colonPattern = /^:[a-z_]+:$/;
if (!(colonPattern.test(prefix) || emojiPattern.test(prefix))) {
core.setFailed(`Pull request title '${title}' must start with a :gitmoji: or emoji.`);
return;
}
if (!scopePattern.test(rest)) {
core.setFailed(`Pull request title '${title}' does not match ':gitmoji: scope: summary' format.`);
}