From 4b01bbd18ac27c86f36e4ac0caaa3f0498b012c1 Mon Sep 17 00:00:00 2001 From: Anand Pant Date: Fri, 20 Feb 2026 20:03:32 -0600 Subject: [PATCH 1/2] ci: add required checks for PR-only workflow --- .github/pull_request_template.md | 12 ++++++++++ .github/workflows/check.yml | 29 ++++++++++++++++++++++++ .github/workflows/validate-pr-title.yml | 30 +++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/validate-pr-title.yml 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..e5df301 --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,30 @@ +name: ValidatePrTitle + +on: + pull_request_target: + 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" From 4e49420ee44cd093c4858a7a88fdc0d68b848391 Mon Sep 17 00:00:00 2001 From: Anand Pant Date: Fri, 20 Feb 2026 20:04:56 -0600 Subject: [PATCH 2/2] ci: run title validation on pull_request --- .github/workflows/validate-pr-title.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml index e5df301..841af32 100644 --- a/.github/workflows/validate-pr-title.yml +++ b/.github/workflows/validate-pr-title.yml @@ -1,7 +1,7 @@ name: ValidatePrTitle on: - pull_request_target: + pull_request: types: [opened, edited, synchronize, reopened] permissions: