From af595b262e29694a4cb7f1616b97f38471f2711a Mon Sep 17 00:00:00 2001 From: allohamora Date: Tue, 7 Jul 2026 17:40:45 +0300 Subject: [PATCH 1/2] fix: add limit release notes size step --- .github/workflows/release.yml | 9 +++++++++ .../js/release-workflow/preset/index.spec.ts | 11 +++++++++++ .../release-workflow.installer.spec.ts | 9 +++++++++ .../js/release-workflow/preset/default.preset.ts | 11 +++++++++++ 4 files changed, 40 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a89e0f2..675b607 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,6 +88,15 @@ jobs: REMOVE_TITLE: "true" run: npx --no-install git-cliff --latest --strip header -o release-notes.md + - name: Limit release notes size + run: |- + MAX_CHARS=125000 + CHARS=$(wc -m < release-notes.md | tr -d ' ') + if [ "$CHARS" -gt "$MAX_CHARS" ]; then + echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead." + echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md + fi + - name: Create release env: GH_TOKEN: ${{ github.token }} diff --git a/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts b/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts index 0bd5cf3..fbd0650 100644 --- a/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts +++ b/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts @@ -120,6 +120,17 @@ describe('release-workflow/preset', () => { }, run: 'npx --no-install git-cliff --latest --strip header -o release-notes.md', }, + { + name: 'Limit release notes size', + run: [ + 'MAX_CHARS=125000', + "CHARS=$(wc -m < release-notes.md | tr -d ' ')", + 'if [ "$CHARS" -gt "$MAX_CHARS" ]; then', + 'echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', + 'echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', + 'fi', + ].join('\n'), + }, { name: 'Create release', env: { diff --git a/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts b/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts index 834ea08..da21477 100644 --- a/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts +++ b/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts @@ -123,6 +123,15 @@ describe('release-workflow.installer', () => { ' REMOVE_TITLE: "true"', ' run: npx --no-install git-cliff --latest --strip header -o release-notes.md', '', + ' - name: Limit release notes size', + ' run: |-', + ' MAX_CHARS=125000', + " CHARS=$(wc -m < release-notes.md | tr -d ' ')", + ' if [ "$CHARS" -gt "$MAX_CHARS" ]; then', + ' echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', + ' echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', + ' fi', + '', ' - name: Create release', ' env:', ' GH_TOKEN: ${{ github.token }}', diff --git a/src/categories/js/release-workflow/preset/default.preset.ts b/src/categories/js/release-workflow/preset/default.preset.ts index bd11f7f..71c7ecf 100644 --- a/src/categories/js/release-workflow/preset/default.preset.ts +++ b/src/categories/js/release-workflow/preset/default.preset.ts @@ -177,6 +177,17 @@ export const content = { }, run: 'npx --no-install git-cliff --latest --strip header -o release-notes.md', }, + { + name: 'Limit release notes size', + run: [ + 'MAX_CHARS=125000', + "CHARS=$(wc -m < release-notes.md | tr -d ' ')", + 'if [ "$CHARS" -gt "$MAX_CHARS" ]; then', + 'echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', + 'echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', + 'fi', + ].join('\n'), + }, { name: 'Create release', env: { From 0016e0cbae88104e7911bea58649f8c8b4ef1066 Mon Sep 17 00:00:00 2001 From: allohamora Date: Tue, 7 Jul 2026 17:50:11 +0300 Subject: [PATCH 2/2] style: add two spaces to if block in limit release notes size --- .github/workflows/release.yml | 4 ++-- .../unit/categories/js/release-workflow/preset/index.spec.ts | 4 ++-- .../js/release-workflow/release-workflow.installer.spec.ts | 4 ++-- src/categories/js/release-workflow/preset/default.preset.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 675b607..4837d75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,8 +93,8 @@ jobs: MAX_CHARS=125000 CHARS=$(wc -m < release-notes.md | tr -d ' ') if [ "$CHARS" -gt "$MAX_CHARS" ]; then - echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead." - echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md + echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead." + echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md fi - name: Create release diff --git a/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts b/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts index fbd0650..50e65bf 100644 --- a/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts +++ b/__tests__/unit/categories/js/release-workflow/preset/index.spec.ts @@ -126,8 +126,8 @@ describe('release-workflow/preset', () => { 'MAX_CHARS=125000', "CHARS=$(wc -m < release-notes.md | tr -d ' ')", 'if [ "$CHARS" -gt "$MAX_CHARS" ]; then', - 'echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', - 'echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', + ' echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', + ' echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', 'fi', ].join('\n'), }, diff --git a/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts b/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts index da21477..63acda9 100644 --- a/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts +++ b/__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts @@ -128,8 +128,8 @@ describe('release-workflow.installer', () => { ' MAX_CHARS=125000', " CHARS=$(wc -m < release-notes.md | tr -d ' ')", ' if [ "$CHARS" -gt "$MAX_CHARS" ]; then', - ' echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', - ' echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', + ' echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', + ' echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', ' fi', '', ' - name: Create release', diff --git a/src/categories/js/release-workflow/preset/default.preset.ts b/src/categories/js/release-workflow/preset/default.preset.ts index 71c7ecf..17779b3 100644 --- a/src/categories/js/release-workflow/preset/default.preset.ts +++ b/src/categories/js/release-workflow/preset/default.preset.ts @@ -183,8 +183,8 @@ export const content = { 'MAX_CHARS=125000', "CHARS=$(wc -m < release-notes.md | tr -d ' ')", 'if [ "$CHARS" -gt "$MAX_CHARS" ]; then', - 'echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', - 'echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', + ' echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."', + ' echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md', 'fi', ].join('\n'), },