From 63f6c8cc1d350ac2cb1628270e631f5b6fd632ee Mon Sep 17 00:00:00 2001 From: Karan Gathani Date: Tue, 11 Mar 2025 11:10:00 -0700 Subject: [PATCH 1/3] Create conventional-commits.yaml --- .github/workflows/conventional-commits.yaml | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/conventional-commits.yaml diff --git a/.github/workflows/conventional-commits.yaml b/.github/workflows/conventional-commits.yaml new file mode 100644 index 000000000..53f398479 --- /dev/null +++ b/.github/workflows/conventional-commits.yaml @@ -0,0 +1,46 @@ +name: Conventional Commits +on: + pull_request: + types: + - opened + - edited + - synchronize +jobs: + default: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + id: lint + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + build + chore + ci + docs + feat + fix + perf + style + refactor + test + - uses: marocchino/sticky-pull-request-comment@v2 + if: always() && (steps.lint.outputs.error_message != null) + with: + header: lint-error + message: | + Hey there! 👋 + + We noticed that the title of your pull request doesn't follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. To ensure consistency, we kindly ask you to adjust the title accordingly. + + Here are the details: + + ``` + ${{ steps.lint.outputs.error_message }} + ``` + - if: ${{ steps.lint.outputs.error_message == null }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: lint-error + delete: true From 9513894b9adc50143cb1062a8aa0aca7e5ab6939 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 11 Mar 2025 14:24:41 -0400 Subject: [PATCH 2/3] Apply suggestions from code review --- .github/workflows/conventional-commits.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conventional-commits.yaml b/.github/workflows/conventional-commits.yaml index 53f398479..d57f8440b 100644 --- a/.github/workflows/conventional-commits.yaml +++ b/.github/workflows/conventional-commits.yaml @@ -32,13 +32,15 @@ jobs: message: | Hey there! 👋 - We noticed that the title of your pull request doesn't follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. To ensure consistency, we kindly ask you to adjust the title accordingly. + We noticed that the title of your pull request doesn't follow the + [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) + specification. To ensure consistency, we kindly ask you to adjust the + title accordingly. Here are the details: - ``` ${{ steps.lint.outputs.error_message }} - ``` + - if: ${{ steps.lint.outputs.error_message == null }} uses: marocchino/sticky-pull-request-comment@v2 with: From a432535d8365a4411f56221df62034927dc9de12 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 11 Mar 2025 14:27:12 -0400 Subject: [PATCH 3/3] Apply suggestions from code review --- .github/workflows/conventional-commits.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/conventional-commits.yaml b/.github/workflows/conventional-commits.yaml index d57f8440b..8f2acffd8 100644 --- a/.github/workflows/conventional-commits.yaml +++ b/.github/workflows/conventional-commits.yaml @@ -32,12 +32,11 @@ jobs: message: | Hey there! 👋 - We noticed that the title of your pull request doesn't follow the - [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) - specification. To ensure consistency, we kindly ask you to adjust the - title accordingly. + We noticed that the title of your pull request doesn't follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. To ensure consistency, we kindly ask you to adjust the title accordingly. - Here are the details: + Details are below the break: + + ---------------------------- ${{ steps.lint.outputs.error_message }}