Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32486,6 +32486,7 @@ const exec = __importStar(__nccwpck_require__(5236));
const github = __importStar(__nccwpck_require__(3228));
const fs = __importStar(__nccwpck_require__(1943));
const path = __importStar(__nccwpck_require__(6928));
const crypto_1 = __nccwpck_require__(6982);
const sdk_1 = __nccwpck_require__(6381);
const dead_code_1 = __nccwpck_require__(1655);
/** Fields that should be redacted from logs */
Expand Down Expand Up @@ -32579,9 +32580,8 @@ async function generateIdempotencyKey(workspacePath) {
});
const commitHash = output.trim();
const repoName = path.basename(workspacePath);
// Add timestamp to ensure unique key per run (avoids 409 conflicts on re-runs)
const timestamp = Date.now();
return `${repoName}:deadcode:${commitHash}:${timestamp}`;
// Use UUID to ensure unique key per run (avoids 409 conflicts, scales to many concurrent users)
return `${repoName}:deadcode:${commitHash}:${(0, crypto_1.randomUUID)()}`;
}
async function run() {
try {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as exec from '@actions/exec';
import * as github from '@actions/github';
import * as fs from 'fs/promises';
import * as path from 'path';
import { randomUUID } from 'crypto';
import { Configuration, DefaultApi } from '@supermodeltools/sdk';
import { findDeadCode, formatPrComment } from './dead-code';

Expand Down Expand Up @@ -112,10 +113,9 @@ async function generateIdempotencyKey(workspacePath: string): Promise<string> {

const commitHash = output.trim();
const repoName = path.basename(workspacePath);
// Add timestamp to ensure unique key per run (avoids 409 conflicts on re-runs)
const timestamp = Date.now();

return `${repoName}:deadcode:${commitHash}:${timestamp}`;
// Use UUID to ensure unique key per run (avoids 409 conflicts, scales to many concurrent users)
return `${repoName}:deadcode:${commitHash}:${randomUUID()}`;
}

async function run(): Promise<void> {
Expand Down