Skip to content

Commit

Permalink
Allow configuring gitlab deploy tokens via config command, refs compo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Nov 4, 2020
1 parent 04aad52 commit fc0d724
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Composer/Command/ConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ function ($vals) {
}
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));
} elseif ($matches[1] === 'gitlab-token' && 2 === count($values)) {
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'token' => $values[1]));
} elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token', 'bearer'), true)) {
if (1 !== count($values)) {
throw new \RuntimeException('Too many arguments, expected only one token');
Expand Down

0 comments on commit fc0d724

Please sign in to comment.