fix: verify territorial recovery manifest with canonical Git line endings
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -8,13 +8,16 @@ use RuntimeException;
|
|||||||
/** Exact replay of the 28 accepted links into the transported project identities. */
|
/** Exact replay of the 28 accepted links into the transported project identities. */
|
||||||
final class ApprovedAnchorTerritories
|
final class ApprovedAnchorTerritories
|
||||||
{
|
{
|
||||||
public const HASH = 'dc3ae2014da51005d95780e2e4ae87e55e000e66e0765f0671c6e44a958026a0';
|
public const HASH = 'd2893d0a638d630435aca1890f79a8094dc58eb65bbdd65a470bb685fa075190';
|
||||||
|
|
||||||
/** @return array{manifest_sha256:string,projects:list<array<string,mixed>>,links:list<array<string,mixed>>} */
|
/** @return array{manifest_sha256:string,projects:list<array<string,mixed>>,links:list<array<string,mixed>>} */
|
||||||
public function plan(): array
|
public function plan(): array
|
||||||
{
|
{
|
||||||
$file = base_path('docs/investmoz/unification/approved-anchor-territories-20261023.json');
|
$file = base_path('docs/investmoz/unification/approved-anchor-territories-20261023.json');
|
||||||
$contents = is_file($file) ? file_get_contents($file) : false;
|
$contents = is_file($file) ? file_get_contents($file) : false;
|
||||||
|
if ($contents !== false) {
|
||||||
|
$contents = str_replace("\r\n", "\n", $contents);
|
||||||
|
}
|
||||||
if ($contents === false || ! hash_equals(self::HASH, hash('sha256', $contents))) {
|
if ($contents === false || ! hash_equals(self::HASH, hash('sha256', $contents))) {
|
||||||
throw new RuntimeException('Reviewed territorial manifest changed.');
|
throw new RuntimeException('Reviewed territorial manifest changed.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user