mirror of
https://github.com/pestphp/pest.git
synced 2026-12-05 15:22:17 +01:00
fix(tia): use jq equality in GitHub artifact size lookup (#1930)
`GitHubRemote::artifactSize()` passes `select(.name === "…")` to
`gh api --jq`. jq has no `===` operator: gh's embedded jq rejects the
filter ("unexpected token"), so the lookup always fails and the baseline
download never shows its size.
The filter used `==` while it lived in `BaselineSync`, which the strict
arch preset ignores. #1841 moved it into `GitHubRemote`, where the preset
flags the `==` inside the jq string. Restore `==` and ignore
`GitHubRemote` in the strict preset, as `BaselineSync` already is.
This commit is contained in:
@@ -83,7 +83,7 @@ final readonly class GitHubRemote extends BaseRemote
|
||||
'gh', 'api',
|
||||
sprintf('repos/%s/actions/runs/%s/artifacts', $repo, $runId),
|
||||
'--jq', sprintf(
|
||||
'.artifacts[] | select(.name === "%s") | .size_in_bytes',
|
||||
'.artifacts[] | select(.name == "%s") | .size_in_bytes',
|
||||
self::ARTIFACT_NAME,
|
||||
),
|
||||
]);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Pest\Expectation;
|
||||
use Pest\Plugins\Tia\Baselines\GitHubRemote;
|
||||
use Pest\Plugins\Tia\BaselineSync;
|
||||
|
||||
arch()->preset()->php()->ignoring([
|
||||
@@ -17,6 +18,7 @@ arch()->preset()->php()->ignoring([
|
||||
|
||||
arch()->preset()->strict()->ignoring([
|
||||
BaselineSync::class,
|
||||
GitHubRemote::class,
|
||||
'usleep',
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user