chore: add CI/CD workflows, issue templates, and CODEOWNERS #8
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 Checks | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| jobs: | |
| # ───────────────────────────────────────────────────────────── | |
| # Enforce conventional commit style on PR title | |
| # ───────────────────────────────────────────────────────────── | |
| pr-title: | |
| name: PR Title Convention | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check PR title | |
| uses: amannn/action-semantic-pull-request@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| # Allowed prefixes: feat, fix, docs, chore, refactor, test, perf, ci | |
| types: | | |
| feat | |
| fix | |
| docs | |
| chore | |
| refactor | |
| test | |
| perf | |
| ci | |
| requireScope: false | |
| # ───────────────────────────────────────────────────────────── | |
| # Auto-label PRs based on files changed | |
| # ───────────────────────────────────────────────────────────── | |
| label: | |
| name: Auto Label | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Label PR | |
| uses: actions/labeler@v5 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| # ───────────────────────────────────────────────────────────── | |
| # Remind contributors to include tests | |
| # ───────────────────────────────────────────────────────────── | |
| tests-reminder: | |
| name: Tests Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for test files in PR | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| CHANGED=$(gh pr diff ${{ github.event.pull_request.number }} --name-only) | |
| APP_CHANGES=$(echo "$CHANGED" | grep -c "^app/" || true) | |
| TEST_CHANGES=$(echo "$CHANGED" | grep -c "^tests/" || true) | |
| if [ "$APP_CHANGES" -gt 0 ] && [ "$TEST_CHANGES" -eq 0 ]; then | |
| echo "::warning::This PR changes application code but adds no tests. Please consider adding tests." | |
| else | |
| echo "Tests included. Good to go." | |
| fi |