diff --git a/koji_forgejo_webhook.py b/koji_forgejo_webhook.py index 87cd743..d86f7ad 100644 --- a/koji_forgejo_webhook.py +++ b/koji_forgejo_webhook.py @@ -27,7 +27,8 @@ class KojiProcessor: def __init__(self): pass - def koji_build_shell(self, build_target: str, git_url: str, scratch: bool = True, nowait: bool = True) -> str: + def koji_build_shell(self, build_target: str, git_url: str, + scratch: bool = True, nowait: bool = True) -> str: result = {"out": "", "err": ""} # Construct the koji build command @@ -124,8 +125,12 @@ class ForgejoWebhookProcessor: git_url = f"git+{clone_url}#{commit_id}" + scratch = True + if 'release' in ref.lower(): + scratch = False + if app.config.get('KOJI_USE_SHELL'): - result = KojiProcessor().koji_build_shell(app.config['KOJI_TARGET'], git_url) + result = KojiProcessor().koji_build_shell(app.config['KOJI_TARGET'], git_url, scratch=scratch) else: result = KojiProcessor().koji_build(app.config['KOJI_SERVER'], app.config['KOJI_TARGET'], git_url)