diff --git a/action/index.cjs b/action/index.cjs index 9d5b763..f9482b5 100644 --- a/action/index.cjs +++ b/action/index.cjs @@ -188167,8 +188167,12 @@ const robot = (app) => { return; } const tokensDirectories = (response.data && response.data.length) ? response.data : []; - const subdirectories = tokensDirectories.filter((content) => content?.type === "dir" && content?.name?.startsWith(tokenTicker)); - if (subdirectories.length) { + const subdirectoriesWithSameTicker = tokensDirectories.filter((content) => content?.type === "dir" && content?.name?.startsWith(tokenTicker)); + if (subdirectoriesWithSameTicker.length) { + if (subdirectoriesWithSameTicker[0].name === tokenName) { + // it's just an update to the same token + return; + } await fail(`Token with ticker ${tokenTicker} already exists!`); } } diff --git a/src/bot.ts b/src/bot.ts index d924ed2..1fef63f 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -239,11 +239,16 @@ export const robot = (app: Probot) => { return; } const tokensDirectories = (response.data && (response.data as any[]).length) ? response.data as any[] : []; - const subdirectories = tokensDirectories.filter( + const subdirectoriesWithSameTicker = tokensDirectories.filter( (content) => content?.type === "dir" && content?.name?.startsWith(tokenTicker), ); - if (subdirectories.length) { + if (subdirectoriesWithSameTicker.length) { + if (subdirectoriesWithSameTicker[0].name === tokenName) { + // it's just an update to the same token + return; + } + await fail(`Token with ticker ${tokenTicker} already exists!`); } }