Skip to content

Commit

Permalink
fix(ci/arena): Skip checking file against itself for duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Mar 1, 2024
1 parent d1b06f0 commit 1e4bd03
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/arena-intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ jobs:
const newArenaFileName = path.basename(newArenaFile.filename)
console.log(`🗒️ Arena entry in PR: ${newArenaFile}`);
if (newArenaFile.status != 'added') {
flagForManualCheck = true;
}
if (pr.mergeable != false) {
const newArenaEntry = JSON.parse(fs.readFileSync(newArenaFile.filename));
const allArenaFiles = await (await glob.create('arena/*.json')).glob();
Expand All @@ -84,19 +88,16 @@ jobs:
console.log(`➡️ Checking ${newArenaFileName} against existing entries...`);
for (const file of allArenaFiles) {
const existingEntryName = path.basename(file);
if (
existingEntryName === newArenaFileName
&& newArenaFile.status != 'added'
) {
flagForManualCheck = true;
if (existingEntryName === newArenaFileName) {
continue;
}
console.debug(`Checking against ${existingEntryName}...`);
const arenaEntry = JSON.parse(fs.readFileSync(file));
if (arenaEntry.github_repo_url === newArenaEntry.github_repo_url) {
console.log('⚠️ Duplicate detected: ${existingEntryName}');
console.log(`⚠️ Duplicate detected: ${existingEntryName}`);
issues.push(
`The \`github_repo_url\` specified in __${newArenaFileName}__ `
+ `already exists in __${existingEntryName}__. `
Expand Down

0 comments on commit 1e4bd03

Please sign in to comment.