File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff 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
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
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
You can’t perform that action at this time.
0 commit comments