Skip to content

Commit 1d47e41

Browse files
committed
Fixed bug when in a detatched head state
1 parent 2207ed3 commit 1d47e41

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/bumpversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [master]
66

77
jobs:
8-
bumpversion:
8+
version-hint:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4

generate_changelog/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ def main(
8686
else:
8787
repository = Repo(search_parent_directories=True)
8888

89-
current_branch = repository.active_branch
89+
if repository.head.is_detached:
90+
current_branch = repository.head
91+
else:
92+
current_branch = repository.active_branch
9093

9194
# get starting tag based configuration if not passed in
9295
if not starting_tag and config.starting_tag_pipeline:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ ignore = [
161161
"D105", "D106", "D107", "D200", "D212",
162162
"PD011",
163163
"PLW1510",
164+
"B008",
164165
]
165166

166167
# Allow autofix for all enabled rules (when `--fix`) is provided.

0 commit comments

Comments
 (0)