{"path":".github/workflows/semantic-pr.yml","size":1599,"locked":false,"binary":false,"truncated":false,"content":"name: Semantic PR Title\n\non:\n  pull_request_target:\n    types: [opened, edited, synchronize, reopened]\n  push:\n    branches: [main, beta]\n\npermissions:\n  contents: read\n  pull-requests: read\n\njobs:\n  check-title:\n    if: github.event_name == 'pull_request_target'\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Accept Dependabot-generated title\n        if: github.event.pull_request.user.login == 'dependabot[bot]'\n        run: echo \"Dependabot-generated title accepted\"\n\n      - name: Validate conventional title\n        if: github.event.pull_request.user.login != 'dependabot[bot]'\n        uses: amannn/action-semantic-pull-request@v5\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          types: |\n            feat\n            fix\n            docs\n            style\n            refactor\n            perf\n            test\n            build\n            ci\n            chore\n            security\n          requireScope: false\n          subjectPattern: ^(?![A-Z]).+\n          subjectPatternError: |\n            The PR title's subject shouldn't start with an uppercase letter.\n\n  check-commit:\n    if: github.event_name == 'push'\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: actions/checkout@v4\n      - name: Validate commit subject\n        shell: bash\n        run: |\n          subject=\"$(git log -1 --pretty=%s)\"\n          if ! printf '%s\\n' \"$subject\" | grep -Eq '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|security)(\\([^)]+\\))?: [^A-Z].+'; then\n            echo \"Commit subject is not semantic: $subject\" >&2\n            exit 1\n          fi\n"}