Skip to content

Commit 3f88422

Browse files
authored
Auto add changelog moves (#6496)
The changelogs added to .changes/<previous minor version> and changelogs/<previous minor version>.md are new files that are not tracked by Git and it's easy to miss doing a 'git add' for them when running scripts/minor-version-bump. Add them automatically so it's ensured that they're part of the version bump commit.
1 parent 44bea3b commit 3f88422

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/minor-version-bump

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ NEXT_VERSION_SNAPSHOT=$NEXT_MINOR_VERSION.0-SNAPSHOT
77

88
mvn versions:set -DnewVersion=$NEXT_VERSION_SNAPSHOT -DgenerateBackupPoms=false -DprocessAllModules=true
99

10-
mkdir -p .changes/$PREVIOUS_MINOR_VERSION.x
11-
mv .changes/*.json .changes/$PREVIOUS_MINOR_VERSION.x/
12-
mv CHANGELOG.md changelogs/$PREVIOUS_MINOR_VERSION.x-CHANGELOG.md
10+
PREVIOUS_VERSION_CHANGELOGS_DIR=.changes/$PREVIOUS_MINOR_VERSION.x
11+
mkdir -p $PREVIOUS_VERSION_CHANGELOGS_DIR
12+
mv .changes/*.json $PREVIOUS_VERSION_CHANGELOGS_DIR
13+
git add $PREVIOUS_VERSION_CHANGELOGS_DIR
14+
15+
PREVIOUS_CHANGELOG=$PREVIOUS_MINOR_VERSION.x-CHANGELOG.md
16+
mv CHANGELOG.md changelogs/$PREVIOUS_CHANGELOG
17+
git add changelogs/$PREVIOUS_CHANGELOG
18+
1319
echo " #### 👋 _Looking for changelogs for older versions? You can find them in the [changelogs](./changelogs) directory._" > CHANGELOG.md
1420

1521
echo "Version bumped to $NEXT_VERSION_SNAPSHOT"

0 commit comments

Comments
 (0)