ci: Bump peter-evans/create-pull-request from 6 to 8 #198
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: | |
| check-title: | |
| name: Validate PR Title | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| steps: | |
| - name: Check PR title format | |
| uses: amannn/action-semantic-pull-request@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| # Configure allowed commit types | |
| types: | | |
| feat | |
| fix | |
| docs | |
| style | |
| refactor | |
| perf | |
| test | |
| build | |
| ci | |
| chore | |
| revert | |
| a11y | |
| security | |
| # Allow scopes (e.g., feat(button): ...) | |
| requireScope: false | |
| # Validate subject case (sentence case) | |
| subjectPattern: ^(?![A-Z]).+$ | |
| subjectPatternError: | | |
| The subject "{subject}" found in the pull request title "{title}" | |
| didn't match the configured pattern. Please ensure that the subject | |
| doesn't start with an uppercase character. | |
| # Ignore dependabot PRs | |
| ignoreLabels: | | |
| dependencies | |
| automated | |
| # Validate the entire PR title | |
| validateSingleCommit: false | |
| validateSingleCommitMatchesPrTitle: false | |
| - name: Post result comment | |
| if: failure() | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: 'β **PR Title Check Failed**\n\n' + | |
| 'Please format your PR title using the Conventional Commits specification:\n\n' + | |
| '**Format:** `<type>(<scope>): <subject>`\n\n' + | |
| '**Examples:**\n' + | |
| '- `feat: add new prop for autoplay control`\n' + | |
| '- `fix(thumbnail): resolve image loading issue`\n' + | |
| '- `docs: update README with examples`\n\n' + | |
| '**Allowed types:**\n' + | |
| '`feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`, `a11y`, `security`' | |
| }) |