Skip to content

Commit

Permalink
Update run() method to check the merge PR ,to create TAG and publish
Browse files Browse the repository at this point in the history
Signed-off-by: Shreekar <sshreeka@redhat.com>
  • Loading branch information
shreekarSS committed Jun 9, 2022
1 parent 3bfa558 commit 37a3cdf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kebechet/managers/version/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,18 @@ def run( # type: ignore

trigger: BaseTrigger

if (
self.parsed_payload
and utils._is_merge_event(self.parsed_payload)
and utils._is_release_version_pr(self.parsed_payload)
):
tag_version = utils._get_version(self.parsed_payload)
with cloned_repo(self) as repo:
_LOGGER.info(f"Creating Tag of version {tag_version}")
_LOGGER.info(repo.git.execute(["git","tag", f"{tag_version}", f"{utils._get_merge_commit_sha(self.parsed_payload)}"]))
_LOGGER.info(repo.git.execute(["git","push", "origin", f"{tag_version}"]))
return

if (
pr_releases
and self.parsed_payload
Expand Down

0 comments on commit 37a3cdf

Please sign in to comment.