diff --git a/.github/workflows/ai-service-ci.yaml b/.github/workflows/ai-service-ci.yaml index 8858556d7..370f232fb 100644 --- a/.github/workflows/ai-service-ci.yaml +++ b/.github/workflows/ai-service-ci.yaml @@ -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: