Use slash command to trigger CI (#13512)
Co-authored-by: sglang-bot <sglangbot@gmail.com>
This commit is contained in:
4
.github/MAINTAINER.md
vendored
4
.github/MAINTAINER.md
vendored
@@ -36,7 +36,9 @@ __Note__: Difference between Merge Oncall and Codeowner
|
||||
If you meet any issues during the merge, you can discuss in [slack channels](https://slack.sglang.ai/): #dev, #pull-request, and #ci-cd-build-release.
|
||||
|
||||
## The List of Merge Oncalls and Reviewers
|
||||
TODO
|
||||
|
||||
Now we have many Merge Oncalls mainly because the CI is flaky and the CODEOWNERS is too coarse-grained.
|
||||
In the future, we hope the CI can be improved and we only need bypass rarely. After that, most Merge Oncalls can be converted back to Write and CODEOWNERS.
|
||||
|
||||
This list is based on the current situation. If you or someone you know would like to take on more responsibility and are qualified, please ping @Lianmin Zheng and @Ying Sheng in the Slack channel. They will start a nomination and internal review process.
|
||||
|
||||
|
||||
46
.github/workflows/slash_command_handler.yml
vendored
Normal file
46
.github/workflows/slash_command_handler.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Slash Command Handler
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
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 starts with a recognized command
|
||||
if: >
|
||||
github.event.issue.pull_request &&
|
||||
(startsWith(github.event.comment.body, '/tag-run-ci-label') ||
|
||||
startsWith(github.event.comment.body, '/rerun-failed-ci'))
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
# We checkout the current context to get the script,
|
||||
# but the script will fetch permissions from main as requested.
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install requests PyGithub
|
||||
|
||||
- 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/slash_command_handler.py
|
||||
Reference in New Issue
Block a user