mirror of
https://github.com/Canner/WrenAI.git
synced 2026-09-24 23:29:49 +08:00
Enhance the CI with label (#10)
* Running a workflow on labeling * Add the function to cancel the progressing CI * Separate the group by each labels * Add comments * Runs the CI when merged into main branch
This commit is contained in:
@@ -5,19 +5,26 @@ name: AI Service CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
types: [ labeled ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
# avoid mis-canceling the ci runs while other labels are added to the PR, so we add the label name as the condition
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.label.name == 'ci/ai-service' && github.event.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: wren-ai-service
|
||||
run:
|
||||
working-directory: wren-ai-service
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
if: ${{ github.event.label.name == 'ci/ai-service' || github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
Reference in New Issue
Block a user