Skip to content

Commit fdd1992

Browse files
committed
fix action
1 parent d65f1bf commit fdd1992

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@ jobs:
1313
check-main-override:
1414
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
1515
runs-on: ubuntu-latest
16+
outputs:
17+
bypassed: ${{ steps.override.outputs.bypassed }}
1618
steps:
1719
- name: 🛑 Prevent direct push to main without override
20+
id: override
1821
run: |
19-
echo "Checking for override..."
20-
if [[ "${{ github.event.head_commit.message }}" != *"[override-main]"* ]]; then
22+
if [[ "${{ github.event.head_commit.message }}" == *"[override-main]"* ]]; then
23+
echo "✅ Override flag found. Proceeding."
24+
echo "bypassed=true" >> $GITHUB_OUTPUT
25+
else
2126
echo "❌ Direct push to main is blocked. Use a PR or include [override-main] in your commit message."
2227
exit 1
2328
fi
24-
echo "✅ Override flag found. Proceeding."
2529
2630
lint:
2731
name: 🔍 Lint
2832
runs-on: ubuntu-latest
33+
if: github.ref != 'refs/heads/main' || github.event_name != 'push' || needs.check-main-override.result == 'success'
2934
needs: [check-main-override]
3035
steps:
3136
- uses: actions/checkout@v4
@@ -43,6 +48,7 @@ jobs:
4348
typecheck:
4449
name: ✅ Type Check
4550
runs-on: ubuntu-latest
51+
if: github.ref != 'refs/heads/main' || github.event_name != 'push' || needs.check-main-override.result == 'success'
4652
needs: [check-main-override]
4753
steps:
4854
- uses: actions/checkout@v4
@@ -60,6 +66,7 @@ jobs:
6066
build:
6167
name: 🔨 Build
6268
runs-on: ubuntu-latest
69+
if: github.ref != 'refs/heads/main' || github.event_name != 'push' || needs.check-main-override.result == 'success'
6370
needs: [check-main-override]
6471
steps:
6572
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)