From 72c304abca02d0cdaddb2175cac497d3eb41636f Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 7 Apr 2024 10:11:06 +0800 Subject: [PATCH 1/3] chore: add pull-requests write access to pr title action --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bf0538c5f2..bfd5417836 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,6 +3,8 @@ name: PR on: pull_request: types: [opened, edited, synchronize] +permissions: + pull-requests: write jobs: check-title: From e20e8b4d7d2fb01849632b8728e3a1aced3262e5 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 7 Apr 2024 10:18:07 +0800 Subject: [PATCH 2/3] fix --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bfd5417836..6f288822b8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,6 +26,7 @@ jobs: message: | ✅ PR title meet the requirements. comment_tag: PR title check result + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: thollander/actions-comment-pull-request@v2 if: failure() @@ -33,3 +34,4 @@ jobs: message: | 🚨 PR title does not meet the requirements. It must start with one of the following prefixes: 'feat:', 'fix:', 'chore:', 'break:'. comment_tag: PR title check result + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6c4bcc1578ea1a26e4f0d3a5b351d43585820570 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 7 Apr 2024 10:30:23 +0800 Subject: [PATCH 3/3] remove logic --- .github/workflows/pr.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6f288822b8..88232d9ff3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,8 +3,6 @@ name: PR on: pull_request: types: [opened, edited, synchronize] -permissions: - pull-requests: write jobs: check-title: @@ -19,19 +17,3 @@ jobs: const title = context.payload.pull_request.title.toLowerCase(); const titleHasValidPrefix = titlePrefixes.some((prefix) => title.startsWith(`${prefix}:`)); if (!titleHasValidPrefix) { process.exit(-1); } - - - uses: thollander/actions-comment-pull-request@v2 - if: success() - with: - message: | - ✅ PR title meet the requirements. - comment_tag: PR title check result - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: thollander/actions-comment-pull-request@v2 - if: failure() - with: - message: | - 🚨 PR title does not meet the requirements. It must start with one of the following prefixes: 'feat:', 'fix:', 'chore:', 'break:'. - comment_tag: PR title check result - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}