Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run-ci:
- changed-files:
- any-glob-to-any-file:
- '**/*'
Comment on lines +3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current glob pattern '**/*' is very broad and will match any file change in the repository, including documentation, .gitignore files, or other non-code assets. This will cause the run-ci label to be applied to every pull request, potentially triggering unnecessary CI workflows and consuming resources. It's better to restrict this to files that actually require CI validation, such as source code and test files. Please adapt the suggested patterns to your project's specific structure.

    - any-glob-to-any-file:
      - 'src/**/*'
      - 'tests/**/*'
      # Add other relevant files/directories that should trigger CI

21 changes: 1 addition & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,10 @@ on:
branches: [ "main" ]
types: [opened, synchronize, reopened, labeled]

jobs:
init-label:
if: github.event.action == 'opened'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add run-ci label
env:
GH_TOKEN: ${{ github.token }}
run: gh pr edit ${{ github.event.pull_request.number }} --add-label "run-ci"

jobs:
build:
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -206,10 +195,6 @@ jobs:

test-sglang-integration:
needs: build-flags
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-latest
env:
tone_user_name: ${{ secrets.TONE_USER_NAME }}
Expand Down Expand Up @@ -266,7 +251,6 @@ jobs:

build-flags:
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -412,7 +396,6 @@ jobs:
build-docker:
name: Build Docker Image
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-22.04
Expand All @@ -428,7 +411,6 @@ jobs:
spell-check:
name: Spell Check with Typos
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-22.04
Expand All @@ -441,7 +423,6 @@ jobs:
clang-format:
name: Check code format
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: ubuntu-22.04
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Auto Label PRs

on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Auto-label
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
sync-labels: false
dot: true
Loading