File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,7 +196,17 @@ private function initClient(): MittwaldAPIV2Client
196196 throw new \RuntimeException ('Deployer variable "mittwald_project_id" is not set or empty. ' );
197197 }
198198
199- $ this ->client = MittwaldAPIV2Client::newWithToken (get ('mittwald_api_client ' ));
199+ $ apiToken = (string ) get ('mittwald_api_client ' );
200+ if ('' === trim ($ apiToken )) {
201+ throw new \RuntimeException (
202+ 'Deployer variable "mittwald_api_client" resolved to an empty string. '
203+ . 'If this value comes from a CI/CD variable, check that it is not restricted '
204+ . 'to protected branches/refs (e.g. GitLab "Protect variable"), since feature '
205+ . 'branches are typically unprotected. '
206+ );
207+ }
208+
209+ $ this ->client = MittwaldAPIV2Client::newWithToken ($ apiToken );
200210 return $ this ->client ;
201211 }
202212
You can’t perform that action at this time.
0 commit comments