Skip to content

try again

try again #3

Workflow file for this run

name: 🚨 CI Checks
on:
push:
branches:
- main
- staging
pull_request:
branches:
- '**'
jobs:
check-main-override:
runs-on: ubuntu-latest

Check failure on line 14 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 14
steps:
- name: 🛑 Block direct pushes to main (unless override flag)
run: |
echo "🔍 Checking push context: ${{ github.event_name }} → ${{ github.ref }}"
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
if [[ "${{ github.event.head_commit.message }}" != *"[override-main]"* ]]; then
echo "❌ Direct push to main is blocked. Use a PR or include [override-main] in your commit message."
exit 1
else
echo "✅ Override flag found. Allowing push to main."
fi
else
echo "ℹ️ Not a direct push to main. Skipping protection."
fi
lint:
name: 🔍 Lint
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name != 'push' || needs.check-main-override.result == 'success'
needs: [check-main-override]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- name: 📦 Install dependencies
run: yarn install --frozen-lockfile
- name: Run Linter
run: yarn lint
typecheck:
name: ✅ Type Check
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name != 'push' || needs.check-main-override.result == 'success'
needs: [check-main-override]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- name: 📦 Install dependencies
run: yarn install --frozen-lockfile
- name: Run TypeScript
run: yarn typecheck
build:
name: 🔨 Build
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name != 'push' || needs.check-main-override.result == 'success'
needs: [check-main-override]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- name: 📦 Install dependencies
run: yarn install --frozen-lockfile
- name: ⚡ Cache .next build
uses: actions/cache@v4
with:
path: .next
key: next-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
next-${{ runner.os }}-
- name: Build App
run: yarn build