Skip to content

Commit 794a235

Browse files
bjoernricksgreenbonebot
authored andcommitted
Change: Determine git signing key when necessary only
The application may return way before the signing key is necessary. Therefore avoid wasting resources and only gather it when required.
1 parent 357d65f commit 794a235

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pontos/release/create.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@ async def async_run( # type: ignore[override]
212212
github_pre_release: Enforce uploading a release as a GitHub pre
213213
release
214214
"""
215-
git_signing_key = (
216-
git_signing_key
217-
if git_signing_key is not None
218-
else find_signing_key(self.terminal)
219-
)
220215
self.git_tag_prefix = git_tag_prefix or ""
221216
self.repository = repository
222217

@@ -304,6 +299,12 @@ async def async_run( # type: ignore[override]
304299

305300
commit_msg = f"Automatic release to {release_version}"
306301

302+
git_signing_key = (
303+
git_signing_key
304+
if git_signing_key is not None
305+
else find_signing_key(self.terminal)
306+
)
307+
307308
# check if files have been modified and create a commit
308309
status = list(self.git.status())
309310
if status:

0 commit comments

Comments
 (0)