diff --git a/src/Commands/pm/SecurityUpdateCommands.php b/src/Commands/pm/SecurityUpdateCommands.php index 208ffdf0c4..b81e2a6192 100644 --- a/src/Commands/pm/SecurityUpdateCommands.php +++ b/src/Commands/pm/SecurityUpdateCommands.php @@ -95,6 +95,11 @@ public function suggestComposerCommand($updates): void /** * Fetches the generated composer.json from drupal-security-advisories. * + * This function fetches the generated composer.json from the + * drupal-security-advisories repository or fetches it from another source + * if the environment variable DRUSH_SECURITY_ADVISORIES_URL is set. The + * environment variable is not a supported API. + * * @return mixed * * @throws \Exception @@ -102,7 +107,8 @@ public function suggestComposerCommand($updates): void protected function fetchAdvisoryComposerJson() { $client = new Client(['handler' => $this->getStack()]); - $response = $client->get('https://raw.githubusercontent.com/drupal-composer/drupal-security-advisories/9.x/composer.json'); + $security_advisories_composer_url = getenv('DRUSH_SECURITY_ADVISORIES_URL') ?: 'https://raw.githubusercontent.com/drupal-composer/drupal-security-advisories/9.x/composer.json'; + $response = $client->get($security_advisories_composer_url); $security_advisories_composer_json = json_decode($response->getBody(), true); return $security_advisories_composer_json; }