Skip to content

Commit 4961f01

Browse files
committed
[override-main]
1 parent 490e2f8 commit 4961f01

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
name: 🚨 CI Checks
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
58
branches:
6-
- '**'
9+
- main
10+
- staging
711

812
jobs:
913
check-main-override:
14+
if: github.event_name == 'push'
1015
runs-on: ubuntu-latest
1116
steps:
1217
- name: 🛑 Block direct pushes to main (unless override flag)
1318
run: |
1419
echo "🔍 Event: ${{ github.event_name }} | Ref: ${{ github.ref }}"
15-
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
20+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
1621
COMMIT_MSG="${{ github.event.head_commit.message }}"
1722
echo "🔍 Commit message: $COMMIT_MSG"
1823
if [[ "$COMMIT_MSG" != *"[override-main]"* ]]; then
@@ -22,13 +27,13 @@ jobs:
2227
echo "✅ Override flag found. Proceeding."
2328
fi
2429
else
25-
echo "ℹ️ Not a direct push to main. Proceeding."
30+
echo "ℹ️ Not a push to main — skipping override check."
2631
fi
2732
2833
lint:
2934
name: 🔍 Lint
35+
if: github.event_name == 'pull_request'
3036
runs-on: ubuntu-latest
31-
needs: check-main-override
3237
steps:
3338
- uses: actions/checkout@v4
3439
- uses: actions/setup-node@v4
@@ -40,8 +45,8 @@ jobs:
4045

4146
typecheck:
4247
name: ✅ Type Check
48+
if: github.event_name == 'pull_request'
4349
runs-on: ubuntu-latest
44-
needs: check-main-override
4550
steps:
4651
- uses: actions/checkout@v4
4752
- uses: actions/setup-node@v4
@@ -53,8 +58,8 @@ jobs:
5358

5459
build:
5560
name: 🔨 Build
61+
if: github.event_name == 'pull_request'
5662
runs-on: ubuntu-latest
57-
needs: check-main-override
5863
steps:
5964
- uses: actions/checkout@v4
6065
- uses: actions/setup-node@v4

0 commit comments

Comments
 (0)