Skip to content

Commit

Permalink
Improve configuration checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndpnt committed Oct 29, 2024
1 parent 1eace8e commit 5f02583
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/reporter/duplicate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { Octokit } from 'octokit';
async function removeDuplicateIssues() {
try {
const repository = config.get('@opentermsarchive/engine.reporter.githubIssues.repositories.declarations');
if (!repository) {
throw new Error('Repository configuration is not set');

if (!repository.includes('/') || repository.includes('https://')) {
throw new Error(`Configuration entry "reporter.githubIssues.repositories.declarations" is expected to be a string in the format <owner>/<repo>, but received: "${repository}"`);
}

const [ owner, repo ] = repository.split('/');

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

0 comments on commit 5f02583

Please sign in to comment.