Skip to content

Commit

Permalink
Use GITHUB_REF when available
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou committed Jun 28, 2024
1 parent cd70520 commit 7888b70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/infra/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ def local_branch():
if tag_or_none:
return tag_or_none

# ADO
# ADO or GHA
short = None
if "SYSTEM_PULLREQUEST_SOURCEBRANCH" in os.environ:
short = os.environ["SYSTEM_PULLREQUEST_SOURCEBRANCH"]
else:
ref = os.environ["BUILD_SOURCEBRANCH"]
ref = os.environ.get("BUILD_SOURCEBRANCH") or os.environ.get("GITHUB_REF")
for prefix in ["refs/heads/", "refs/tags/", "refs/pull/"]:
if ref.startswith(prefix):
short = ref[len(prefix) :]
Expand Down

0 comments on commit 7888b70

Please sign in to comment.