Skip to content

Commit

Permalink
Merge pull request #71 from akeneo/NEL-add-commit-sha-in-log
Browse files Browse the repository at this point in the history
Add commit sha in log when Nelson tries to merge a PR (3/3)
  • Loading branch information
amigaire authored May 7, 2024
2 parents 258175f + de4f9ac commit e750160
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions spec/Akeneo/Git/PullRequestMergerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function it_merges_a_pull_request(Client $client, PullRequest $githubMerg
'base' => [
'user' => ['login' => 'nelson'],
'repo' => ['name' => 'akeneo/repo'],
'sha' => 'master_branch_sha',
],
'head' => [
'sha' => 'pr_sha',
],
]);
Expand Down
3 changes: 2 additions & 1 deletion src/Akeneo/Git/PullRequestMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function mergePullRequest(array $pullRequest): void
$this->eventDispatcher->dispatch(
new GenericEvent($this, [
'number' => $pullRequest['number'],
'commit_sha' => $pullRequest['head']['sha'],
]),
Events::PRE_GITHUB_MERGE_PR,
);
Expand All @@ -33,7 +34,7 @@ public function mergePullRequest(array $pullRequest): void
$pullRequest['base']['repo']['name'],
$pullRequest['number'],
$mergeTitle,
$pullRequest['base']['sha'],
$pullRequest['head']['sha'],
);

$this->eventDispatcher->dispatch(
Expand Down
2 changes: 1 addition & 1 deletion src/Akeneo/Resources/translations/en.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ pre_github_check_diff: Vérifie les différences avec la branche courante
post_github_check_diff: '%diff% différence(s) trouvée(s) !'
pre_crowdin_packages: Vérifie les archives à mettre à jour
post_crowdin_packages: '%count% archive(s) trouvée(s) !'
pre_github_merge_pr: 'Merge Pull Request %number%'
pre_github_merge_pr: 'Merge Pull Request %number% . Commit: %commit_sha% '
post_github_merge_pr: 'Pull Request mergée!'
2 changes: 1 addition & 1 deletion src/Akeneo/Resources/translations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ pre_crowdin_packages: 'Checking packages to update'
post_crowdin_packages: '%count% package(s) found!'
nelson_rename: 'Rename %from% to %to%'
nelson_drop_useless: 'Drop useless file %file%'
pre_github_merge_pr: 'Merging Pull Request %number%'
pre_github_merge_pr: 'Merging Pull Request %number% . Commit: %commit_sha% '
post_github_merge_pr: 'Pull Request merged!'

0 comments on commit e750160

Please sign in to comment.