Skip to content

Commit ea9c631

Browse files
authored
Merge pull request #90 from hnez/fix-version-checks
CI: fix distribution version consistency checks
2 parents ee2930e + 8f11e8b commit ea9c631

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/distribution-version.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ def check_version(distro_version):
6767

6868
def check_codename(codename):
6969
base_ref = os.environ.get("GITHUB_BASE_REF")
70-
ref = os.environ.get("GITHUB_REF")
70+
ref = os.environ.get("GITHUB_REF_NAME")
71+
ref_type = os.environ.get("GITHUB_REF_TYPE")
7172

72-
if base_ref is not None:
73+
if base_ref:
7374
print(f"Checking codename {codename} against pull request into {base_ref}")
7475
assert codename == f"tacos-{base_ref}"
75-
elif ref is not None:
76+
elif ref and ref_type == "branch":
7677
print(f"Checking codename {codename} against branch {ref}")
7778
assert codename == f"tacos-{ref}"
79+
elif ref_type == "tag":
80+
print("Running for a tag. Skipping codename check")
7881
else:
7982
print("Running outside of GitHub CI. Skipping codename check")
80-
return
8183

8284

8385
def main():

0 commit comments

Comments
 (0)