Skip to content

Commit f0eaa26

Browse files
committed
Do not try to merge commit hash tag in PR
1 parent cbd7dd8 commit f0eaa26

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tagging/apps/merge_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from tagging.apps.config import Config
1717
from tagging.utils.get_platform import ALL_PLATFORMS
1818
from tagging.utils.get_prefix import get_file_prefix_for_platform
19+
from tagging.utils.git_helper import GitHelper
1920

2021
docker = plumbum.local["docker"]
2122

@@ -95,6 +96,13 @@ def merge_tags(
9596
if not push_to_registry:
9697
args.append("--dry-run")
9798

99+
commit_hash_tag = GitHelper.commit_hash_tag()
100+
if not push_to_registry and merged_tag.endswith(commit_hash_tag):
101+
LOGGER.info(
102+
f"Not running merge for tag: {merged_tag} as it's a commit SHA tag and it wasn't pushed to registry"
103+
)
104+
return
105+
98106
LOGGER.info(f"Running command: {' '.join(args)}")
99107
docker[args] & plumbum.FG
100108
if push_to_registry:

0 commit comments

Comments
 (0)