diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..bc7c8e4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## Summary + +- + +## Validation + +- [ ] `bun run check` +- [ ] `bun run typecheck` + +## Notes + +- diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..c32cc62 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,29 @@ +name: Check + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + Check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.8 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Biome check + run: bun run check + + - name: TypeScript typecheck + run: bun run typecheck diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 0000000..841af32 --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,30 @@ +name: ValidatePrTitle + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + pull-requests: read + +jobs: + ValidatePrTitle: + name: ValidatePrTitle + runs-on: ubuntu-latest + steps: + - name: Validate pull request title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + title="${PR_TITLE}" + if [ -z "${title// /}" ]; then + echo "PR title cannot be empty." + exit 1 + fi + + if [[ "$title" =~ ^[Ww][Ii][Pp]([:\ ]|$) ]]; then + echo "PR title cannot start with WIP." + exit 1 + fi + + echo "PR title is valid: $title"