Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set the URL for the security advisories composer url via env variable #5180

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Commands/pm/SecurityUpdateCommands.php
Expand Up @@ -95,14 +95,20 @@ 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
*/
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';
Cyberschorsch marked this conversation as resolved.
Show resolved Hide resolved
$response = $client->get($security_advisories_composer_url);
$security_advisories_composer_json = json_decode($response->getBody(), true);
return $security_advisories_composer_json;
}
Expand Down