signal-desktop/danger/rules.ts

29 lines
690 B
TypeScript
Raw Permalink Normal View History

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { run } from 'endanger';
import migrateBackboneToRedux from './rules/migrateBackboneToRedux';
import packageJsonVersionsShouldBePinned from './rules/packageJsonVersionsShouldBePinned';
2022-12-06 01:13:20 +00:00
function isGitDeletedError(error: unknown) {
return (
typeof error === 'object' &&
error != null &&
2022-12-22 17:36:46 +00:00
error['exitCode'] === 128 &&
2022-12-06 01:13:20 +00:00
error['command']?.startsWith('git show ')
);
}
async function main() {
try {
await run(migrateBackboneToRedux(), packageJsonVersionsShouldBePinned());
} catch (error: unknown) {
if (!isGitDeletedError(error)) {
throw error;
}
2022-12-06 01:13:20 +00:00
}
}
main();