From 6e6d57efffdf824a7553cc321204ecc6ca61439a Mon Sep 17 00:00:00 2001 From: Tibor Leupold Date: Thu, 7 Aug 2025 09:18:45 -0700 Subject: [PATCH] Don't fail when not on Heroku When we are not on Heroku, the check should not fail. Also spread the logic out to make it more readable. --- birdbath/checks/contrib/heroku.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/birdbath/checks/contrib/heroku.py b/birdbath/checks/contrib/heroku.py index 4681979..114f4bb 100644 --- a/birdbath/checks/contrib/heroku.py +++ b/birdbath/checks/contrib/heroku.py @@ -6,7 +6,13 @@ class HerokuNotProductionCheck(BaseCheck): def check(self): heroku_app_name = os.environ.get("HEROKU_APP_NAME") - return heroku_app_name and "production" not in heroku_app_name + if not heroku_app_name: + # When the variable is not set, we are not on Heroku. + return true + if "production" in heroku_app_name: + # If the variable is set and contains "production" we want to fail. + return false + return true class HerokuAnonymisationAllowedCheck(BaseCheck):