Skip to content

Commit

Permalink
BUGFIX - Commit author not used
Browse files Browse the repository at this point in the history
  • Loading branch information
omarlopesino committed Oct 31, 2024
1 parent 45c7e77 commit a6de7a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function setAuthor(string $author) : void {
}

public function getAuthor() : string {
return $this->author;
return $this->author ?? self::DEFAULT_COMMIT_AUTHOR;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Config/ConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

interface ConfigInterface
{

const DEFAULT_COMMIT_AUTHOR = 'Drupal <drupal@artifact-builder>';

/**
* Branch where artifact is pushed.
*
Expand Down
3 changes: 2 additions & 1 deletion src/DrupalArtifactBuilderGit.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function configure() {
parent::configure();
$this->setDescription('Commit and push artifact changes to git.');
$this->addOption('branch', 'b', InputOption::VALUE_REQUIRED,'Git branch');
$this->addOption('author', 'a', InputOption::VALUE_REQUIRED,'Git commit author', 'Drupal <drupal@artifact-builder>');
$this->addOption('author', 'a', InputOption::VALUE_REQUIRED,'Git commit author');
}

/**
Expand All @@ -45,6 +45,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) {
if ($input->hasOption('author') && !empty($input->getOption('author'))) {
$this->getConfiguration()->setAuthor($input->getOption('author'));
}
$this->log(sprintf('Commit author: %s', $this->getConfiguration()->getAuthor()));

$this->assertRepository();
}
Expand Down

0 comments on commit a6de7a5

Please sign in to comment.