Skip to content

refactor: update references from api-template to boringstack-api and … #3

refactor: update references from api-template to boringstack-api and …

refactor: update references from api-template to boringstack-api and … #3

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 }}
permissions:
contents: read
jobs:
drift:
name: apps/ui ACL types are fresh
defaults:
run:
working-directory: apps/api
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout monorepo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.13
- 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