ci: restrict workflows to main branch

This commit is contained in:
2026-10-30 03:44:05 +08:00
parent a80448ae36
commit 10a50e32db
4 changed files with 8 additions and 5 deletions
+4 -3
View File
@@ -11,8 +11,7 @@ name: ci
on:
push:
branches: [main, "ci/**"]
pull_request:
branches: [main]
workflow_dispatch:
env:
@@ -20,6 +19,7 @@ env:
jobs:
python:
if: gitea.ref == 'refs/heads/main'
runs-on: ubuntu24.04-x64-lean4.35
timeout-minutes: 20
steps:
@@ -50,6 +50,7 @@ jobs:
.venv/bin/lean-bench doctor --skip-llm --env /dev/null
lean:
if: gitea.ref == 'refs/heads/main'
needs: python
runs-on: ubuntu24.04-x64-lean4.35
timeout-minutes: 150
@@ -82,7 +83,7 @@ jobs:
image:
needs: [python, lean]
if: github.event_name != 'pull_request'
if: ${{ gitea.ref == 'refs/heads/main' && (github.event_name != 'pull_request') }}
runs-on: ubuntu24.04-x64-lean4.35
timeout-minutes: 180
steps:
+2 -1
View File
@@ -2,13 +2,14 @@ name: env-probe
on:
push:
branches: ["ci/**"]
branches: [main]
paths:
- ".gitea/workflows/env-probe.yml"
workflow_dispatch:
jobs:
probe:
if: gitea.ref == 'refs/heads/main'
runs-on: ubuntu24.04-x64-lean4.35
timeout-minutes: 15
steps:
+1
View File
@@ -10,6 +10,7 @@ on:
jobs:
probe:
if: gitea.ref == 'refs/heads/main'
runs-on: gitea-cicd-server-for-CODEX
timeout-minutes: 10
steps:
@@ -11,7 +11,7 @@ on:
jobs:
expand-root:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.confirm == 'EXPAND_RUNNER_ROOT' }}
if: ${{ gitea.ref == 'refs/heads/main' && (github.event_name == 'workflow_dispatch' && inputs.confirm == 'EXPAND_RUNNER_ROOT') }}
runs-on: ubuntu24.04-x64-lean4.35
timeout-minutes: 20
steps: