Skip to content

Commit 593cbd0

Browse files
committed
improves github ref check
Signed-off-by: Olla Gabriele <[email protected]>
1 parent 0503430 commit 593cbd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coverage_comment/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ def clean_github_output(cls, value: str) -> pathlib.Path:
125125
@property
126126
def GITHUB_PR_NUMBER(self) -> int | None:
127127
# "refs/pull/2/merge"
128-
if "pull" in self.GITHUB_REF:
128+
if self.GITHUB_REF.startswith("refs/pull"):
129129
return int(self.GITHUB_REF.split("/")[2])
130130
return None
131131

132132
@property
133133
def GITHUB_BRANCH_NAME(self) -> str | None:
134134
# "refs/heads/my_branch_name"
135-
if "heads" in self.GITHUB_REF:
135+
if self.GITHUB_REF.startswith("refs/heads"):
136136
return self.GITHUB_REF.split("/", 2)[2]
137137
return None
138138

0 commit comments

Comments
 (0)