From 88ebdea3a519ad08f8e58241cdde3d3cac8c94b8 Mon Sep 17 00:00:00 2001 From: Lin Yang Date: Mon, 2 Dec 2024 15:12:33 +0800 Subject: [PATCH] ci: set continue-on-error to false in pr-title-checker action (#496) * ci: set continue-on-error to false in pr-title-checker action Signed-off-by: Lin Yang * feat: improve the workflow Signed-off-by: Lin Yang * feat: improve the workflow Signed-off-by: Lin Yang --------- Signed-off-by: Lin Yang (cherry picked from commit 76b43e62093ab88d43ede4fb872573cc8e48e611) --- .github/workflows/pr-title-check.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index f3b80d242..6cc52bf0d 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -26,15 +26,19 @@ jobs: - name: PR Title Check uses: thehanimo/pr-title-checker@v1.4.3 id: check - continue-on-error: true with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} pass_on_octokit_error: false configuration_path: ".github/pr-title-checker-config.json" + fail: + name: PR Title Check Failed + runs-on: ubuntu-latest + if: ${{ always() && steps.check.outputs.success == 'false'}} + steps: - name: Add comment to fix PR title uses: marocchino/sticky-pull-request-comment@v2 - if: ${{ steps.check.outputs.success == 'false'}} + id: comment-fail with: header: 'PR Title Check' recreate: true @@ -47,15 +51,21 @@ jobs: * `feat: add new feature AB#789` * `chore: fixing build pipeline` - no AB reference * `build(deps): bump BlahBlah from 1.0 to 1.1` - * `[WIP] feat: add new feature AB#123` - * `[CHERRY-PICK] fix: fix typo in README.md AB#123` - * `[BACKPORT] fix: fix typo in README.md AB#123` + * `[wip] feat: add new feature AB#123` + * `[cherry-pick] fix: fix typo in README.md AB#123` + * `[backport] fix: fix typo in README.md AB#123` For more details, please refer to the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0) and the [PR Title Configuration File](.github/pr-title-checker-config.json). + - name: Set action status to failed + run: exit 1 + success: + name: PR Title Check Passed + runs-on: ubuntu-latest + if: ${{ always() && steps.check.outputs.success == 'true'}} + steps: - name: Add comment that PR title is fixed - if: ${{ steps.check.outputs.success == 'true'}} uses: marocchino/sticky-pull-request-comment@v2 with: header: 'PR Title Check'