Skip to content

Commit f9a0f20

Browse files
committed
try again
1 parent fdd1992 commit f9a0f20

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ on:
1111

1212
jobs:
1313
check-main-override:
14-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
15-
runs-on: ubuntu-latest
16-
outputs:
17-
bypassed: ${{ steps.override.outputs.bypassed }}
18-
steps:
19-
- name: 🛑 Prevent direct push to main without override
20-
id: override
21-
run: |
22-
if [[ "${{ github.event.head_commit.message }}" == *"[override-main]"* ]]; then
23-
echo "✅ Override flag found. Proceeding."
24-
echo "bypassed=true" >> $GITHUB_OUTPUT
25-
else
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: 🛑 Block direct pushes to main (unless override flag)
17+
run: |
18+
echo "🔍 Checking push context: ${{ github.event_name }} → ${{ github.ref }}"
19+
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
20+
if [[ "${{ github.event.head_commit.message }}" != *"[override-main]"* ]]; then
2621
echo "❌ Direct push to main is blocked. Use a PR or include [override-main] in your commit message."
2722
exit 1
23+
else
24+
echo "✅ Override flag found. Allowing push to main."
2825
fi
26+
else
27+
echo "ℹ️ Not a direct push to main. Skipping protection."
28+
fi
2929
3030
lint:
3131
name: 🔍 Lint

0 commit comments

Comments
 (0)