Exit with error message when API token is missing

This commit is contained in:
galfert 2021-01-29 11:06:31 +01:00
parent 8b82b8b159
commit cbfd25e880
No known key found for this signature in database
GPG Key ID: 942831AA5471AB49

View File

@ -67,6 +67,12 @@ if (isNaN(endTimestamp)) {
process.exit(1);
}
// check for existence of GITHUB_TOKEN and GITEA_TOKEN
if (!process.env.GITHUB_TOKEN || !process.env.GITEA_TOKEN) {
console.log('Please set both GITHUB_TOKEN and GITEA_TOKEN');
process.exit(1);
}
const startDate = new Date(startTimestamp);
const endDate = new Date(endTimestamp);