provide draft flag to build policy

Related: https://pagure.io/koji/issue/4014
This commit is contained in:
Mike McLean 2024-02-14 13:23:23 -05:00 committed by Tomas Kopecek
parent d6a59cb585
commit ecd5d96023
2 changed files with 2 additions and 1 deletions

View file

@ -1123,6 +1123,7 @@ class BuildTask(BaseTaskHandler):
'build_tag': build_tag, # id
'skip_tag': bool(self.opts.get('skip_tag')),
'scratch': opts.get('scratch'),
'draft': opts.get('draft'),
'from_scm': SCM.is_scm_url(src),
'repo_id': opts.get('repo_id'),
}

View file

@ -9863,7 +9863,7 @@ class IsDraftTest(koji.policy.BaseSimpleTest):
def run(self, data):
if 'draft' in data:
return data['draft']
return bool(data['draft'])
if 'build' in data:
build = get_build(data['build'])
return build.get('draft', False)