Skip to content

Commit a3b37de

Browse files
authored
πŸ”– From prod β†’ Bump version: v1.1.6-prod into main (#35)
Automatically created pull request for release v1.1.6-prod into main branch.
2 parents 7c36faa + 98e3143 commit a3b37de

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

β€Ž.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.2
2+
current_version = 1.1.6
33
commit = True
44
tag = False
55

β€Ž.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373
stages: [pre-push]
7474
- id: commit-msg-version-check
7575
name: commit-msg-version-check
76-
entry: python commit_msg_version_bump/main.py --log-level=INFO
76+
entry: python commit_msg_version_bump/main.py --log-level=DEBUG
7777
always_run: true
7878
language: system
7979
pass_filenames: false

β€Žcommit_msg_version_bump/main.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,18 @@ def get_new_version(pyproject_path: str = "pyproject.toml") -> str:
171171
sys.exit(1)
172172

173173

174-
def add_icon_and_prepare_commit_message(
175-
commit_type: str, current_version: str, new_version: str
176-
) -> str:
174+
def add_icon_and_prepare_commit_message(current_version: str, new_version: str) -> str:
177175
"""
178176
Prepares the new commit message with the icon and version bump.
179177
180178
Args:
181-
commit_type (str): The type of the commit (e.g., 'chore', 'fix').
182179
current_version (str): The current version before bump.
183180
new_version (str): The new version after bump.
184181
185182
Returns:
186183
str: The new commit message.
187184
"""
188-
icon = TYPE_MAPPING.get(commit_type.lower(), "")
185+
icon = "πŸ”–"
189186
new_commit_msg = f"{icon} Bump version: {current_version} β†’ {new_version}"
190187
logger.debug(f"New commit message: {new_commit_msg}")
191188
return new_commit_msg
@@ -272,7 +269,6 @@ def main() -> None:
272269
commit_type = type_match.group("type")
273270
logger.debug(f"Detected commit type: {commit_type}")
274271
else:
275-
commit_type = "chore" # Default to 'chore' if no type is found
276272
logger.debug("No commit type detected. Defaulting to 'chore'.")
277273

278274
version_bump_part = determine_version_bump(latest_commit_msg)
@@ -286,9 +282,7 @@ def main() -> None:
286282

287283
new_version = get_new_version()
288284

289-
updated_commit_msg = add_icon_and_prepare_commit_message(
290-
commit_type, current_version, new_version
291-
)
285+
updated_commit_msg = add_icon_and_prepare_commit_message(current_version, new_version)
292286

293287
# Stage the updated pyproject.toml
294288
stage_changes()
@@ -313,6 +307,7 @@ def determine_version_bump(commit_msg: str) -> Optional[str]:
313307
Returns:
314308
Optional[str]: The version part to bump ('major', 'minor', 'patch') or None.
315309
"""
310+
logger.debug(f"Detected commit message: {commit_msg}")
316311
match = VERSION_KEYWORD_REGEX.search(commit_msg)
317312
if match:
318313
keyword = match.group("keyword").lower()

β€Žcontrol_commit/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ def main() -> None:
227227
logger.debug(f"Commit message already has icon '{icon}'.")
228228
break
229229

230-
if icon_present:
230+
if commit_msg.__contains__("Bump version:"):
231+
logger.debug("Commit message with icon is valid.")
232+
sys.exit(0) # Valid commit message with icon; proceed
233+
elif icon_present:
231234
# Validate the commit message without the icon
232235
if not validate_commit_message(commit_msg_without_icon):
233236
logger.error("Commit message validation failed after removing icon. Aborting commit.")

β€Žpyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "scripts"
3-
version = "1.1.2"
3+
version = "1.1.6"
44
description = "CICD Core Scripts"
55
authors = ["B <[email protected]>"]
66
license = "Apache 2.0"

0 commit comments

Comments
Β (0)