From 04e73859f70b3c4c683c160f33d3ff313a6d13f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Wed, 28 Jun 2023 12:31:13 +0800 Subject: [PATCH] workflow: optimize pr check and cr --- .github/workflows/cr.yml | 7 ++++--- .github/workflows/pr-check-title.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml index 0eef777b..2b6c900c 100644 --- a/.github/workflows/cr.yml +++ b/.github/workflows/cr.yml @@ -6,10 +6,11 @@ permissions: on: pull_request: - types: [opened, reopened] + types: [ opened, reopened, synchronize, labeled ] jobs: test: + if: ${{ contains(github.event.pull_request.labels.*.name, '🚀 Review Ready') }} runs-on: ubuntu-latest steps: - uses: anc95/ChatGPT-CodeReview@main @@ -17,5 +18,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_ENDPOINT: https://api.openai-sb.com/v1 - MODEL: gpt-3.5-turbo-16k - LANGUAGE: Chinese + MODEL: gpt-3.5-turbo + PROMPT: "Below is a code patch, please help me do a brief code review on it. Only answer important bug risks and/or improvement suggestions, Answer must be concisely and short: " diff --git a/.github/workflows/pr-check-title.yml b/.github/workflows/pr-check-title.yml index 306d44af..1318c976 100644 --- a/.github/workflows/pr-check-title.yml +++ b/.github/workflows/pr-check-title.yml @@ -7,5 +7,5 @@ jobs: steps: - uses: Slashgear/action-check-pr-title@v4.3.0 with: - regexp: "^(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release|revert)(\\(.+\\))?!?: .+$|^Merge .+$" + regexp: "^(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release|revert)(\\(.+\\))?!?: .+" helpMessage: "Your PR title is invalid. Please follow the Conventional Commits specification: https://www.conventionalcommits.org/zh-hans/v1.0.0/"