Skip to content

Commit a6ea3c5

Browse files
committed
define backport commit message in constant
1 parent 3537bea commit a6ea3c5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/update-release-branch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
1414
"""
1515

16+
# NB: This exact commit message is used to find commits for reverting during backports.
17+
# Changing it requires a transition period where both old and new versions are supported.
18+
BACKPORT_COMMIT_MESSAGE = 'Update version and changelog for v'
1619

1720
# Name of the remote
1821
ORIGIN = 'origin'
@@ -287,7 +290,7 @@ def main():
287290
# This commit will not exist the first time we release the v{N-1} branch from the v{N} branch, so we
288291
# use `git log --grep` to conditionally revert the commit.
289292
print('Reverting the version number and changelog updates from the last release to avoid conflicts')
290-
vOlder_update_commits = run_git('log', '--grep', '^Update version and changelog for v', '--format=%H').split()
293+
vOlder_update_commits = run_git('log', '--grep', f'^{BACKPORT_COMMIT_MESSAGE}', '--format=%H').split()
291294

292295
if len(vOlder_update_commits) > 0:
293296
print(f' Reverting {vOlder_update_commits[0]}')
@@ -329,7 +332,7 @@ def main():
329332

330333
# Amend the commit generated by `npm version` to update the CHANGELOG
331334
run_git('add', 'CHANGELOG.md')
332-
run_git('commit', '-m', f'Update version and changelog for v{version}')
335+
run_git('commit', '-m', f'{BACKPORT_COMMIT_MESSAGE}{version}')
333336
else:
334337
# If we're performing a standard release, there won't be any new commits on the target branch,
335338
# as these will have already been merged back into the source branch. Therefore we can just

0 commit comments

Comments
 (0)