Skip to content

Commit 7eec1ed

Browse files
authored
fix(release-check): pass -version to gorelease (#144)
Without -version, gorelease resolves the release candidate via MVS over the module graph instead of reading the working tree. When a dependency transitively requires an older version of the module being released (e.g. boxo depends on go-libp2p-kad-dht, which depends on boxo), MVS picks that older version as the candidate and the diff report comes out inverted, flagging all symbols introduced in the current release as "removed" and suggesting an unnecessary minor bump. Passing -version (already computed and validated via semver earlier in the workflow) forces gorelease to use the working tree as the candidate, restoring correct base-to-head comparison.
1 parent 307057d commit 7eec1ed

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/release-check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ jobs:
208208
env:
209209
LANGUAGE: ${{ github.event.pull_request.base.repo.language }}
210210
PREV_TAG: ${{ steps.prev.outputs.tag }}
211+
VERSION: v${{ steps.version.outputs.version }}
211212
# see https://github.com/golang/exp/commits/master/cmd/gorelease
212213
run: |
213214
git config advice.detachedHead false
@@ -219,7 +220,11 @@ jobs:
219220
echo "\`gorelease\` says:" >> $GITHUB_OUTPUT
220221
echo "\`\`\`" >> $GITHUB_OUTPUT
221222
echo "Run gorelease"
222-
((gorelease -base "$PREV_TAG") 2>&1 || true) | tee -a $GITHUB_OUTPUT
223+
# Pass -version so gorelease uses the working tree as the release candidate.
224+
# Without it, gorelease resolves the candidate via MVS over the module graph,
225+
# which picks the wrong version when a dependency transitively requires an
226+
# older version of the module being released (e.g. boxo -> kad-dht).
227+
((gorelease -base "$PREV_TAG" -version "$VERSION") 2>&1 || true) | tee -a $GITHUB_OUTPUT
223228
echo "\`\`\`" >> $GITHUB_OUTPUT
224229
echo "" >> $GITHUB_OUTPUT
225230
echo "\`gocompat\` says:" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)