From 0e8d134da021f5c0d3de24c2457c224b105fcb32 Mon Sep 17 00:00:00 2001 From: Yun Wang Date: Mon, 22 Jun 2026 17:31:39 +0200 Subject: [PATCH 1/3] chore: derive release bump only from the title bang marker The release workflow scanned the PR title and body for the conventional-commits major-bump phrase and forced a major bump on any match. Prose that merely referenced the phrase, including a sentence stating there was none, tripped it. This is the same footgun already fixed in getstream-ruby and stream-py. Treat the `!` marker in the conventional-commits title (e.g. `feat!:`) as the sole major signal and stop reading the PR body entirely. Drop the now-unused --body / --body-file options and the body plumbing in release.yml. --- .github/workflows/release.yml | 4 ---- scripts/bump_version.sh | 25 ++++--------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b47ee0a..0eb3a04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,13 +66,9 @@ jobs: if: github.event_name == 'pull_request' && steps.already_released.outputs.value != 'true' env: PR_TITLE: ${{ github.event.pull_request.title }} - PR_BODY: ${{ github.event.pull_request.body }} run: | - PR_BODY_FILE=$(mktemp) - printf '%s' "$PR_BODY" > "$PR_BODY_FILE" bash scripts/bump_version.sh \ --title "$PR_TITLE" \ - --body-file "$PR_BODY_FILE" \ --output "$GITHUB_OUTPUT" - name: Determine version bump (manual) diff --git a/scripts/bump_version.sh b/scripts/bump_version.sh index 1fbaa98..fc864dd 100644 --- a/scripts/bump_version.sh +++ b/scripts/bump_version.sh @@ -3,8 +3,6 @@ set -euo pipefail title="" -body="" -body_file="" output="" manual_bump="" use_current_version="false" @@ -15,14 +13,6 @@ while [[ $# -gt 0 ]]; do title="${2:-}" shift 2 ;; - --body) - body="${2:-}" - shift 2 - ;; - --body-file) - body_file="${2:-}" - shift 2 - ;; --output) output="${2:-}" shift 2 @@ -42,19 +32,12 @@ while [[ $# -gt 0 ]]; do esac done -if [[ -n "${body_file}" ]]; then - body="$(<"${body_file}")" -fi - determine_bump() { local pr_title="$1" - local pr_body="$2" - - if [[ "${pr_body}" =~ BREAKING[[:space:]-]CHANGE ]] || [[ "${pr_title}" =~ BREAKING[[:space:]-]CHANGE ]]; then - echo "major" - return - fi + # Breaking changes are signalled only by the `!` marker in the title + # (e.g. `feat!:`). Free-text body/title prose is not trusted: a PR that + # merely mentions the major-bump phrase must not force a major bump. if ! echo "${pr_title}" | grep -Eq '^([a-zA-Z]+)(\([^)]+\))?(!)?:'; then echo "none" return @@ -158,7 +141,7 @@ if [[ -n "${manual_bump_normalized}" ]]; then exit 0 fi -bump="$(determine_bump "${title}" "${body}")" +bump="$(determine_bump "${title}")" if [[ "${bump}" == "none" ]]; then write_output "should_release" "false" From 6f634e29e359386fead62f8d392c81a2876a74bb Mon Sep 17 00:00:00 2001 From: Yun Wang Date: Mon, 22 Jun 2026 17:42:44 +0200 Subject: [PATCH 2/3] chore: trigger release only on master, drop dead main entry This repo's default branch is master and there is no main branch, so the `- main` entry in the release trigger was dead config. Keep only `- master`. --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0eb3a04..ad1db4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,6 @@ on: pull_request: types: [closed] branches: - - main - master concurrency: From 558ecd4256582aa6b6e5eb8806a6c40f915c0063 Mon Sep 17 00:00:00 2001 From: Yun Wang Date: Mon, 22 Jun 2026 17:44:44 +0200 Subject: [PATCH 3/3] docs: align README release rules with title-only bump on master Drop the "BREAKING CHANGE in the PR body/title" rule (bump now comes from the title `!` marker only) and the `main` branch reference (releases trigger on master). --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e37c4de..2eeb158 100644 --- a/README.md +++ b/README.md @@ -84,14 +84,14 @@ The SDK follows .NET best practices and conventions while providing a clean, mai Releases use two paths, both handled by `.github/workflows/release.yml`: -- **Default**: automatic release when a PR is merged to `main`/`master`. The PR title (and body) drives the semver bump. +- **Default**: automatic release when a PR is merged to `master`. The PR title drives the semver bump. - **Fallback**: manual release via the `Release` workflow's `workflow_dispatch` (admin use). Select a `version_bump` (`patch`/`minor`/`major`). `use_current_version=true` skips the bump and publishes whatever is already in `src/stream-feed-net.csproj`. Automatic semver bump rules: - `feat:` -> minor - `fix:` (or `bug:`) -> patch -- `feat!:`, `(scope)!:`, or `BREAKING CHANGE` in the PR body/title -> major +- `feat!:` or `(scope)!:` (the `!` marker) -> major PRs with any other prefix do not trigger a release.