94057c3d3e
CI Model Inventory / build-inventory (push) Waiting to run
Lint / lint (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark Compilation Check (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark - Manual Policy (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark - Request Processing (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark Summary (push) Blocked by required conditions
Release SGLang Model Gateway Docker Image / publish (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on macos (aarch64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on windows (x86_64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on macos (x86_64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (aarch64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (x86_64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (aarch64 - musllinux_1_1) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (x86_64 - musllinux_1_1) (push) Waiting to run
Release SGLang Model Gateway to PyPI / Build SDist (push) Waiting to run
Release SGLang Model Gateway to PyPI / Upload to PyPI (push) Blocked by required conditions
Release SGLang Kernels / build-cu129-matrix (aarch64, 12.9, 3.10, arm-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / build-cu129-matrix (x86_64, 12.9, 3.10, x64-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / release-cu129 (push) Blocked by required conditions
Release SGLang Kernels / build-cu130-matrix (aarch64, 13.0, 3.10, arm-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / build-cu130-matrix (x86_64, 13.0, 3.10, x64-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / release-cu130 (push) Blocked by required conditions
Release SGLang Kernels / build-rocm-matrix (3.10, 700) (push) Waiting to run
PR Test (SMG) / build-wheel (push) Waiting to run
PR Test (SMG) / python-unit-tests (push) Blocked by required conditions
PR Test (SMG) / unit-tests (push) Waiting to run
PR Test (SMG) / benchmarks (push) Blocked by required conditions
PR Test (SMG) / chat-completions (push) Blocked by required conditions
PR Test (SMG) / chat-completions-4gpu (push) Blocked by required conditions
PR Test (SMG) / e2e (push) Blocked by required conditions
PR Test (SMG) / docker-build-test (push) Waiting to run
PR Test (SMG) / k8s-integration (push) Waiting to run
PR Test (SMG) / finish (push) Blocked by required conditions
PR Test (SMG) / summarize-benchmarks (push) Blocked by required conditions
Release SGLang Kernels / build-rocm-matrix (3.10, 720) (push) Waiting to run
Release SGLang Kernels / release-rocm700 (push) Blocked by required conditions
Release SGLang Kernels / release-rocm720 (push) Blocked by required conditions
Release SGLang Kernels / build-musa43 (43, 3.10) (push) Waiting to run
Release SGLang Kernels / release-musa43 (push) Blocked by required conditions
PR Test (NPU) / check-changes (push) Has been cancelled
PR Test (NPU) / pr-gate (push) Has been cancelled
PR Test (NPU) / set-image-config (push) Has been cancelled
PR Test (NPU) / stage-b-test-1-npu-a2 (0) (push) Has been cancelled
PR Test (NPU) / stage-b-test-1-npu-a2 (1) (push) Has been cancelled
PR Test (NPU) / stage-b-test-2-npu-a2 (0) (push) Has been cancelled
PR Test (NPU) / stage-b-test-2-npu-a2 (1) (push) Has been cancelled
PR Test (NPU) / stage-b-test-4-npu-a3 (push) Has been cancelled
PR Test (NPU) / stage-b-test-16-npu-a3 (push) Has been cancelled
PR Test (NPU) / multimodal-gen-test-1-npu-a3 (push) Has been cancelled
PR Test (NPU) / multimodal-gen-test-2-npu-a3 (push) Has been cancelled
PR Test (Arm64) / pr-gate (push) Has been cancelled
PR Test (Arm64) / check-changes (push) Has been cancelled
PR Test (Arm64) / build-test (push) Has been cancelled
PR Test (sgl-router) / gate (push) Has been cancelled
PR Test (sgl-router) / tier-1 — lint (push) Has been cancelled
PR Test (sgl-router) / tier-2 — build + test (push) Has been cancelled
PR Test (sgl-router) / tier-3 — docker (placeholder) (push) Has been cancelled
PR Test (sgl-router) / tier-3 — k8s integration (push) Has been cancelled
PR Test (sgl-router) / tier-3 — e2e (push) Has been cancelled
PR Test (sgl-router) / finish (push) Has been cancelled
PR Test (NPU) / single-node-poc (map[name:qwen3_6_27b_w8a8_1p_in64k_out1k_50ms runner:linux-aarch64-a3-2 test_case:test/registered/ascend/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_1p_in64k_out1k_50ms.py test_type:perf]) (push) Has been cancelled
PR Test (NPU) / pr-test-npu-finish (push) Has been cancelled
PR Test (Xeon) / pr-gate (push) Has been cancelled
PR Test (Xeon) / check-changes (push) Has been cancelled
PR Test (Xeon) / build-test (, xeon-gnr, base-b-test-cpu) (push) Has been cancelled
PR Test (XPU) / check-changes (push) Has been cancelled
PR Test (XPU) / pr-gate (push) Has been cancelled
PR Test (XPU) / stage-a-test-1-gpu-xpu (push) Has been cancelled
PR Test (XPU) / wait-for-stage-a (push) Has been cancelled
PR Test (XPU) / stage-b-test-1-gpu-xpu (push) Has been cancelled
PR Test (XPU) / finish (push) Has been cancelled
101 lines
4.2 KiB
YAML
101 lines
4.2 KiB
YAML
name: Slash Command Handler
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created, edited]
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write # Required to add labels and reactions
|
|
actions: write # Required to rerun workflows
|
|
issues: write # Required for comment reactions in some contexts
|
|
|
|
jobs:
|
|
slash_command:
|
|
# Only run if it is a PR and the comment contains a recognized command
|
|
# Use contains() since startsWith() can't handle leading whitespace/newlines
|
|
if: >
|
|
github.event.issue.pull_request &&
|
|
(contains(github.event.comment.body, '/tag-run-ci-label') ||
|
|
contains(github.event.comment.body, '/rerun-failed-ci') ||
|
|
contains(github.event.comment.body, '/tag-and-rerun-ci') ||
|
|
contains(github.event.comment.body, '/rerun-stage') ||
|
|
contains(github.event.comment.body, '/rerun-group') ||
|
|
contains(github.event.comment.body, '/rerun-test'))
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# SECURITY: This workflow runs on issue_comment trigger with elevated permissions
|
|
# (pull-requests: write, actions: write). For non-fork PRs, we can safely checkout
|
|
# the PR branch to allow testing changes to this handler. For fork PRs, we MUST
|
|
# stay on main to prevent untrusted code execution with these elevated permissions.
|
|
- name: Get PR details
|
|
id: pr
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
PR_DATA=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json headRefName,headRepositoryOwner) || {
|
|
echo "::error::Failed to fetch PR data"
|
|
exit 1
|
|
}
|
|
# Use 'empty' filter to handle null/missing values (e.g., deleted forks)
|
|
HEAD_OWNER=$(echo "$PR_DATA" | jq -r '.headRepositoryOwner.login // empty')
|
|
REPO_OWNER="${{ github.repository_owner }}"
|
|
# Treat missing/null owner as fork for security (fail-safe)
|
|
if [[ -z "$HEAD_OWNER" || "$HEAD_OWNER" != "$REPO_OWNER" ]]; then
|
|
IS_FORK="true"
|
|
else
|
|
IS_FORK="false"
|
|
fi
|
|
echo "is_fork=$IS_FORK" >> $GITHUB_OUTPUT
|
|
echo "ref=$(echo "$PR_DATA" | jq -r '.headRefName')" >> $GITHUB_OUTPUT
|
|
echo "pr_ref=refs/pull/${{ github.event.issue.number }}/head" >> $GITHUB_OUTPUT
|
|
echo "PR owner: $HEAD_OWNER, Repo owner: $REPO_OWNER, Is fork: $IS_FORK"
|
|
|
|
- name: Check commenter permission for fork PRs
|
|
id: perm
|
|
if: steps.pr.outputs.is_fork == 'true'
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
PERM=$(gh api repos/${{ github.repository }}/collaborators/${{ github.event.comment.user.login }}/permission --jq '.permission') || {
|
|
PERM="none"
|
|
echo "::warning::Failed to check commenter permission, defaulting to none"
|
|
}
|
|
if [[ "$PERM" == "admin" || "$PERM" == "maintain" || "$PERM" == "write" ]]; then
|
|
echo "safe_to_checkout_pr=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "safe_to_checkout_pr=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
echo "Commenter ${{ github.event.comment.user.login }} permission: $PERM"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# For non-fork PRs: checkout PR branch by name
|
|
# For fork PRs with trusted commenter: checkout via refs/pull/N/head
|
|
# For fork PRs with untrusted commenter: stay on main for security
|
|
ref: ${{ steps.pr.outputs.is_fork == 'false' && steps.pr.outputs.ref || (steps.perm.outputs.safe_to_checkout_pr == 'true' && steps.pr.outputs.pr_ref || '') }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install PyGithub PyYAML
|
|
|
|
- name: Handle Slash Command
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPO_FULL_NAME: ${{ github.repository }}
|
|
PR_NUMBER: ${{ github.event.issue.number }}
|
|
COMMENT_ID: ${{ github.event.comment.id }}
|
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
USER_LOGIN: ${{ github.event.comment.user.login }}
|
|
run: |
|
|
python scripts/ci/utils/slash_command_handler.py
|