Skip to content

Commit

Permalink
ci: fix PR detection (#23235)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrainer-materialize authored Nov 16, 2023
1 parent 4f8597c commit 176e4ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion misc/python/materialize/buildkite.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def is_in_pull_request() -> bool:


def is_pull_request_marker_set() -> bool:
return ui.env_is_truthy("BUILDKITE_PULL_REQUEST")
# If set, this variable will contain either the ID of the pull request or the string "false".
return os.getenv("BUILDKITE_PULL_REQUEST", "false") != "false"


def is_on_default_branch() -> bool:
Expand Down
4 changes: 2 additions & 2 deletions misc/python/materialize/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def shell_quote(args: Iterable[Any]) -> str:


def env_is_truthy(env_var: str) -> bool:
"""Return true if `env_var` is set and is not one of: 0, '', no"""
"""Return true if `env_var` is set and is not one of: 0, '', no, false"""
env = os.getenv(env_var)
if env is not None:
return env not in ("", "0", "no")
return env not in ("", "0", "no", "false")
return False


Expand Down

0 comments on commit 176e4ed

Please sign in to comment.