Skip to content

Commit fe28b52

Browse files
diberryCopilot
andcommitted
Add CI workflow for vector search TypeScript sample
Adds a GitHub Actions workflow that type-checks the TypeScript quickstart on PRs and pushes touching the sample path. Security hardening: - pull_request event (read-only token, no secrets on forks) - Explicit same-repo check skips fork PRs entirely - Concurrency group cancels redundant runs - 10-minute timeout cap - Read-only permissions Uses actions/checkout@v6 and actions/setup-node@v6. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8ce7c4d commit fe28b52

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# CI for the Azure SQL Vector Search TypeScript quickstart sample.
2+
# Security: uses `pull_request` (read-only token, no secrets on forks)
3+
# with an explicit same-repo check to skip fork PRs entirely.
4+
5+
name: "Vector Search TypeScript — Build"
6+
7+
on:
8+
pull_request:
9+
branches: [master]
10+
paths:
11+
- "samples/features/vector-search/vector-search-query-typescript/**"
12+
push:
13+
branches: [master]
14+
paths:
15+
- "samples/features/vector-search/vector-search-query-typescript/**"
16+
17+
# Cancel redundant runs for the same PR / branch.
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
build:
27+
name: Build & type-check
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 10
30+
31+
# Skip CI on fork PRs — prevents external actors from consuming minutes.
32+
if: >-
33+
github.event_name == 'push' ||
34+
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
35+
36+
defaults:
37+
run:
38+
working-directory: samples/features/vector-search/vector-search-query-typescript
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v6
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v6
46+
with:
47+
node-version: "22"
48+
cache: "npm"
49+
cache-dependency-path: samples/features/vector-search/vector-search-query-typescript/package-lock.json
50+
51+
- name: Install dependencies
52+
run: npm ci
53+
54+
- name: Type-check (build)
55+
run: npm run build

0 commit comments

Comments
 (0)