-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (57 loc) · 2.09 KB
/
Copy pathapps-api-acl-drift.yml
File metadata and controls
65 lines (57 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: acl-drift
# Catch apps/ui ACL type drift in the apps/api PR that introduced
# it. The generated file lives in the UI app's tree; without this gate,
# changes to src/lib/acl/acl.constants.ts here ship without the
# corresponding apps/ui regeneration.
on:
push:
branches: [main]
paths:
- "apps/api/src/lib/acl/acl.constants.ts"
- "apps/api/scripts/codegen/generate-acl-types.ts"
- ".github/workflows/apps-api-acl-drift.yml"
pull_request:
paths:
- "apps/api/src/lib/acl/acl.constants.ts"
- "apps/api/scripts/codegen/generate-acl-types.ts"
- ".github/workflows/apps-api-acl-drift.yml"
concurrency:
group: apps-api-acl-drift-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
drift:
name: apps/ui ACL types are fresh
defaults:
run:
working-directory: apps/api
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout monorepo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
- name: Cache bun install
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('apps/api/bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- name: Install apps/api deps
working-directory: apps/api
run: bun install --frozen-lockfile
- name: Check apps/ui ACL types are up-to-date
working-directory: apps/api
env:
BORINGSTACK_UI_DIR: ${{ github.workspace }}/apps/ui
run: |
if ! bun run generate:acl-types:check; then
echo "::error::apps/ui/src/lib/acl/acl.types.generated.ts is stale against this API change."
echo "::error::To fix: from repo root run 'bun run regen' (or 'cd apps/api && bun run generate:acl-types') and commit apps/ui in the same PR."
exit 1
fi