Conversation
…n post-release env
When running the postReleaseCommand, craft set CRAFT_NEW_VERSION to the
just-released version. This polluted shared bump-version scripts that
prefer env vars over positional args — e.g. self-hosted's bump-version.sh
reads NEW_VERSION="${CRAFT_NEW_VERSION:-${2:-}}", so CRAFT_NEW_VERSION
took precedence over the "nightly" positional arg, causing the script to
set the version to the already-current release version. No diff, no
commit, master stays on the release version.
Replace CRAFT_NEW_VERSION/CRAFT_OLD_VERSION with CRAFT_RELEASED_VERSION
in the post-release subprocess environment. The pre-release command
(prepare.ts) still correctly uses CRAFT_NEW_VERSION. Positional args are
kept unchanged for backward compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CRAFT_NEW_VERSIONenv var polluting sharedbump-version.shscriptsCRAFT_NEW_VERSION/CRAFT_OLD_VERSIONwithCRAFT_RELEASED_VERSIONin the post-release subprocess environmentRoot Cause
When
craft publishruns thepostReleaseCommand, it setsCRAFT_NEW_VERSION=<release-version>in the subprocess env. Repos likeself-hostedhave apost-release.shthat callsbump-version.sh '' 'nightly', butbump-version.shreadsNEW_VERSION="${CRAFT_NEW_VERSION:-${2:-}}"— the env var takes precedence over the positional arg, so the version gets "bumped" to the already-current release version instead ofnightly. No diff → no commit → master stays on the release version.This caused the self-hosted 26.4.0 publish to succeed without resetting master to nightly.
Fix
Replace
CRAFT_NEW_VERSION/CRAFT_OLD_VERSIONwithCRAFT_RELEASED_VERSIONinrunPostReleaseCommand(). This letsbump-version.shfall through to the positional arg (nightly) as intended. The pre-release command (prepare.ts) still correctly usesCRAFT_NEW_VERSION.