File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,15 +92,20 @@ def ensure_namespace(kubectl_bin: Path) -> None:
9292
9393
9494def ghcr_credentials () -> tuple [str , str ] | None :
95- username = os .environ .get ("MB3R_GHCR_USERNAME" ) or os . environ . get ( "GITHUB_ACTOR " )
96- token = os .environ .get ("MB3R_GHCR_TOKEN" ) or os . environ . get ( "GITHUB_TOKEN " )
97- if bool (username ) != bool (token ):
95+ explicit_username = os .environ .get ("MB3R_GHCR_USERNAME" )
96+ explicit_token = os .environ .get ("MB3R_GHCR_TOKEN" )
97+ if bool (explicit_username ) != bool (explicit_token ):
9898 raise RuntimeError (
9999 "both registry credentials must be set together: "
100- "MB3R_GHCR_USERNAME + MB3R_GHCR_TOKEN or GITHUB_ACTOR + GITHUB_TOKEN "
100+ "MB3R_GHCR_USERNAME + MB3R_GHCR_TOKEN"
101101 )
102- if username and token :
103- return username , token
102+ if explicit_username and explicit_token :
103+ return explicit_username , explicit_token
104+
105+ fallback_username = os .environ .get ("GITHUB_ACTOR" )
106+ fallback_token = os .environ .get ("GITHUB_TOKEN" )
107+ if fallback_username and fallback_token :
108+ return fallback_username , fallback_token
104109 return None
105110
106111
You can’t perform that action at this time.
0 commit comments