diff --git a/.github/actions/check-maintenance/action.yml b/.github/actions/check-maintenance/action.yml index f45406ad3..cd0558dda 100644 --- a/.github/actions/check-maintenance/action.yml +++ b/.github/actions/check-maintenance/action.yml @@ -1,5 +1,5 @@ name: Check Maintenance Mode -description: Blocks CI when maintenance mode is active (issue #21065 is open), unless the PR has the bypass-maintenance label. +description: Blocks CI when maintenance mode is active (issue #21065 is open), unless the PR has the bypass-maintenance label, or env SGLANG_PR_TEST_BYPASS_MAINTENANCE_ON_MAIN=true (PR Test workflow on main only). inputs: github-token: @@ -18,6 +18,12 @@ runs: REPO="${{ github.repository }}" PR_NUMBER="${{ github.event.pull_request.number }}" + # PR Test workflow only: scheduled runs and runs on main (dispatch / workflow_call) set this env + if [[ "${SGLANG_PR_TEST_BYPASS_MAINTENANCE_ON_MAIN:-}" == "true" ]]; then + echo "✅ PR Test on main branch; bypassing maintenance gate." + exit 0 + fi + # Check if maintenance issue is open (fail-open: if API errors, allow CI to proceed) ISSUE_STATE=$(gh issue view "$MAINTENANCE_ISSUE" --repo "$REPO" --json state --jq '.state' 2>/dev/null || echo "UNKNOWN") diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 2161c6443..aa10b560f 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -57,6 +57,8 @@ env: SGLANG_IS_IN_CI: true SGLANG_CUDA_COREDUMP: "1" SGLANG_JIT_DEEPGEMM_FAST_WARMUP: true + # Schedule / main-branch dispatch / workflow_call from main use refs/heads/main; PR events use refs/pull/*/merge + SGLANG_PR_TEST_BYPASS_MAINTENANCE_ON_MAIN: ${{ github.ref == 'refs/heads/main' && 'true' || 'false' }} permissions: actions: write