Skip to content

Commit 5f02583

Browse files
committed
Improve configuration checks
1 parent 1eace8e commit 5f02583

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/reporter/duplicate/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { Octokit } from 'octokit';
55
async function removeDuplicateIssues() {
66
try {
77
const repository = config.get('@opentermsarchive/engine.reporter.githubIssues.repositories.declarations');
8-
if (!repository) {
9-
throw new Error('Repository configuration is not set');
8+
9+
if (!repository.includes('/') || repository.includes('https://')) {
10+
throw new Error(`Configuration entry "reporter.githubIssues.repositories.declarations" is expected to be a string in the format <owner>/<repo>, but received: "${repository}"`);
1011
}
11-
12+
1213
const [ owner, repo ] = repository.split('/');
1314

1415
const octokit = new Octokit({ auth: process.env.OTA_ENGINE_GITHUB_TOKEN });

0 commit comments

Comments
 (0)