Skip to content

Commit efedb90

Browse files
author
Your Name
committed
Set git configs on CI
1 parent 0d63fa6 commit efedb90

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on: push
33
jobs:
44
phpunit:
55
runs-on: ubuntu-latest
6+
env:
7+
IS_CI_TEST: true
68
steps:
79
- uses: actions/checkout@v1
810
- uses: shivammathur/setup-php@v2

tests/CodeRepository/GitCodeRepositoryTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ private function createGitRepo(): void
3939
$gitPath = self::LOCAL_GIT_PATH;
4040
$fs->mkdir($gitPath);
4141
$fs->dumpFile($gitPath . '/composer.json', '{}');
42+
if (getenv('IS_CI_TEST')) {
43+
`git config --global user.email "you@example.com"`;
44+
`git config --global user.name "Your Name"`;
45+
}
4246
`cd {$gitPath} && git init && git add composer.json && git commit -m "Init"`;
4347
}
4448

0 commit comments

Comments
 (0)