mirror of
https://gh.wpcy.net/https://github.com/elementor/elementor.git
synced 2026-06-18 04:33:19 +08:00
## Summary - Zero-pad the minor version in the generated release branch name so that branches `4.00`–`4.10` sort correctly lexicographically - Updated `scripts/create-version-change.js`: use `String(minor).padStart(2, '0')` instead of bare `minor` - Updated `.github/workflows/create-version-change.yml`: use `printf '%02d' $MINOR` instead of bare `$MINOR` ## Test plan - [ ] Run `node scripts/create-version-change.js` when `package.json` version is `4.2.0` and verify the branch name shown is `4.02` (not `4.2`) - [ ] Confirm branches sort correctly: `echo -e "4.02\n4.10\n4.09" | sort -V` should output `4.02 → 4.09 → 4.10` - [ ] Verify that versions >= `4.10` remain unaffected (no triple-padding) ## Jira [ED-23982](https://elementor.atlassian.net/browse/ED-23982) [ED-23982]: https://elementor.atlassian.net/browse/ED-23982?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!--start_gitstream_placeholder--> ### ✨ PR Description ## 1. Problem & Context Branch names like `4.0` were inconsistent with the upcoming `4.0x` versioning scheme. This standardizes branch naming to zero-pad minor versions (e.g., `4.00`, `4.01`) across both the Node.js script and GitHub Actions workflow, ensuring consistency as versions progress beyond single digits. ## 2. What Changed (Where) - `scripts/create-version-change.js`: Updated branch name format from `${major}.${minor}` to `${major}.${String(minor).padStart(2, '0')}` - `.github/workflows/create-version-change.yml`: Updated shell branch name format from `${MAJOR}.${MINOR}` to `${MAJOR}.$(printf '%02d' $MINOR)` ## 3. How It Works Both files now zero-pad the minor version to two digits when constructing branch names. The JavaScript implementation uses `String.padStart(2, '0')` while the bash workflow uses `printf '%02d'`. For version `4.0`, branch name becomes `4.00`; for `4.1` it becomes `4.01`, and so on through `4.99`. ## 4. Risks Existing branches with old naming format (`4.0`) won't automatically map to new format (`4.00`). Verify that any branch references in CI/CD, merge scripts, or documentation are updated to match the new convention. _Generated by LinearB AI and added by gitStream._ <sub>AI-generated content may contain inaccuracies. Please verify before using. 💡 **Tip:** You can customize your AI Description using **Guidelines** [Learn how](https://docs.gitstream.cm/automation-actions/#describe-changes)</sub> <!--end_gitstream_placeholder--> |
||
|---|---|---|
| .. | ||
| create-version-change.js | ||
| lint-packages-staged.js | ||
| setup-test-environment.sh | ||
| setup-testing.sh | ||