Skip to content

Commit 1b6ca6d

Browse files
committed
Fetch tags manually
1 parent d572b96 commit 1b6ca6d

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

tests/system/AutoReview/CreateNewChangelogTest.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,34 @@ final class CreateNewChangelogTest extends TestCase
2727
{
2828
private string $currentVersion;
2929

30+
public static function setUpBeforeClass(): void
31+
{
32+
parent::setUpBeforeClass();
33+
34+
if (getenv('GITHUB_ACTIONS') !== false) {
35+
exec('git fetch --unshallow 2>&1', $output, $exitCode);
36+
exec('git fetch --tags 2>&1', $output, $exitCode);
37+
38+
if ($exitCode !== 0) {
39+
self::fail(sprintf(
40+
"Failed to fetch git history and tags.\nOutput: %s",
41+
implode("\n", $output),
42+
));
43+
}
44+
}
45+
}
46+
3047
protected function setUp(): void
3148
{
3249
parent::setUp();
3350

34-
exec('git describe --tags --abbrev=0 2>/dev/null', $output, $exitCode);
51+
exec('git describe --tags --abbrev=0 2>&1', $output, $exitCode);
3552

3653
if ($exitCode !== 0) {
37-
$this->markTestSkipped('Unable to determine the current version from git tags.');
54+
$this->markTestSkipped(sprintf(
55+
"Unable to get the latest git tag.\nOutput: %s",
56+
implode("\n", $output),
57+
));
3858
}
3959

4060
// Current tag should already have the next patch docs done, so for testing purposes,

0 commit comments

Comments
 (0)