mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-24 00:39:32 +09:00
29f6ba6310
* chore: add workflow which checks if SPDX ID exists * chore: add missing SPDX ID in some files * chore: change trigger condition * chore: trigger on push * lint
39 lines
856 B
TypeScript
39 lines
856 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import * as process from 'process';
|
|
import * as fs from 'fs';
|
|
import { parseChangeLog } from './parser.js';
|
|
import { checkNewRelease, checkNewTopic } from './checker.js';
|
|
|
|
function abort(message?: string) {
|
|
if (message) {
|
|
console.error(message);
|
|
}
|
|
|
|
process.exit(1);
|
|
}
|
|
|
|
function main() {
|
|
if (!fs.existsSync('./CHANGELOG-base.md') || !fs.existsSync('./CHANGELOG-head.md')) {
|
|
console.error('CHANGELOG-base.md or CHANGELOG-head.md is missing.');
|
|
return;
|
|
}
|
|
|
|
const base = parseChangeLog('./CHANGELOG-base.md');
|
|
const head = parseChangeLog('./CHANGELOG-head.md');
|
|
|
|
const result = (base.length < head.length)
|
|
? checkNewRelease(base, head)
|
|
: checkNewTopic(base, head);
|
|
|
|
if (!result.success) {
|
|
abort(result.message);
|
|
return;
|
|
}
|
|
}
|
|
|
|
main();
|