✨ infra: add unified packagejson and restore proper dependencies #39
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.`); | |
| } |