@neferbyte/cherry-release-cli 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/cherry-release +14 -4
  2. package/package.json +1 -1
@@ -140,13 +140,23 @@ COMMITS_production=""
140
140
  for branch in staging production; do
141
141
  hashes=$(git cherry "origin/$branch" origin/development | grep '^+' | awk '{print $2}')
142
142
 
143
- # Filter out version bump commits (commit-and-tag-version)
143
+ # Filter out version bump commits and already-promoted commits
144
144
  filtered=""
145
145
  for hash in $hashes; do
146
- msg=$(git log -1 --format="%s" "$hash")
147
- if [[ ! "$msg" =~ ^chore\(release\): ]]; then
148
- filtered="$filtered $hash"
146
+ subject=$(git log -1 --format="%s" "$hash")
147
+
148
+ # Skip version bump commits (commit-and-tag-version)
149
+ if [[ "$subject" =~ ^chore\(release\): ]]; then
150
+ continue
151
+ fi
152
+
153
+ # Skip commits whose subject already exists on the target branch
154
+ # (handles cases where git cherry misidentifies due to package.json/lockfile diffs)
155
+ if git log "origin/$branch" --format="%s" | grep -qFx "$subject"; then
156
+ continue
149
157
  fi
158
+
159
+ filtered="$filtered $hash"
150
160
  done
151
161
 
152
162
  eval "COMMITS_${branch}=\"${filtered# }\""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neferbyte/cherry-release-cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Cherry-pick commits across environment branches and tag releases",
5
5
  "license": "MIT",
6
6
  "bin": {