From 1a104eb56352e5475b77ba598f54bdd6f8feb7f8 Mon Sep 17 00:00:00 2001 From: LidolLxf <13660354959@163.com> Date: Thu, 27 Jun 2024 14:47:07 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=96=B0=E5=A2=9Egithub=20action=E8=A7=84?= =?UTF-8?q?=E8=8C=83PR=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/pr-lint.yml diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 0000000000..33fcc45c23 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,14 @@ +name: lint +on: [push, pull_request] +jobs: + pr-format-check: + runs-on: ubuntu-latest + steps: + - name: Check PR naming convention + run: | + title=$(echo "${{ github.event.pull_request.title }}" | awk '{$1=$1};1') + pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*" + if [[ ! $title =~ $pattern ]]; then + echo "PR title does not match naming convention. Example: 'feat: 添加新功能'" + exit 1 + fi \ No newline at end of file From 08f4f1f2b321b44d75d62366d73e939fa8f6901a Mon Sep 17 00:00:00 2001 From: LidolLxf <13660354959@163.com> Date: Thu, 27 Jun 2024 15:02:20 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E5=A2=9Egithub=20action=E8=A7=84?= =?UTF-8?q?=E8=8C=83PR=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 33fcc45c23..2839e85f91 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -6,7 +6,7 @@ jobs: steps: - name: Check PR naming convention run: | - title=$(echo "${{ github.event.pull_request.title }}" | awk '{$1=$1};1') + title=$(echo "${{ github.event.pull_request.title }}") pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*" if [[ ! $title =~ $pattern ]]; then echo "PR title does not match naming convention. Example: 'feat: 添加新功能'" From 71428cdcae1bfb702f9e5df9e192753b26f419ec Mon Sep 17 00:00:00 2001 From: LidolLxf <13660354959@163.com> Date: Thu, 27 Jun 2024 15:03:38 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9Egithub=20action=E8=A7=84?= =?UTF-8?q?=E8=8C=83PR=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 2839e85f91..4f03410f92 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -6,7 +6,7 @@ jobs: steps: - name: Check PR naming convention run: | - title=$(echo "${{ github.event.pull_request.title }}") + title=${{ github.event.pull_request.title }} pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*" if [[ ! $title =~ $pattern ]]; then echo "PR title does not match naming convention. Example: 'feat: 添加新功能'" From 41f6f9045085f201be96e25c2aa6ce98552f3649 Mon Sep 17 00:00:00 2001 From: LidolLxf <13660354959@163.com> Date: Thu, 27 Jun 2024 15:07:06 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=B0=E5=A2=9Egithub=20action=E8=A7=84?= =?UTF-8?q?=E8=8C=83PR=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 4f03410f92..f7f370ed11 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -6,7 +6,7 @@ jobs: steps: - name: Check PR naming convention run: | - title=${{ github.event.pull_request.title }} + title="${{ github.event.pull_request.title }}" pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*" if [[ ! $title =~ $pattern ]]; then echo "PR title does not match naming convention. Example: 'feat: 添加新功能'" From ca1e781298ab86539b31744d8f0d7483aea10a3d Mon Sep 17 00:00:00 2001 From: LidolLxf <13660354959@163.com> Date: Thu, 27 Jun 2024 15:11:03 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=96=B0=E5=A2=9Egithub=20action=E8=A7=84?= =?UTF-8?q?=E8=8C=83PR=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index f7f370ed11..f9b34aeb10 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,7 @@ -name: lint +name: pr-lint on: [push, pull_request] jobs: - pr-format-check: + PR format check: runs-on: ubuntu-latest steps: - name: Check PR naming convention From 42d2351cdd29153f9dd21b5d297775e5de2789be Mon Sep 17 00:00:00 2001 From: LidolLxf <13660354959@163.com> Date: Thu, 27 Jun 2024 15:12:10 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=96=B0=E5=A2=9Egithub=20action=E8=A7=84?= =?UTF-8?q?=E8=8C=83PR=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index f9b34aeb10..2171cf74dc 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,7 @@ name: pr-lint on: [push, pull_request] jobs: - PR format check: + PR-format-check: runs-on: ubuntu-latest steps: - name: Check PR naming convention