Skip to content
Merged
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
4 changes: 3 additions & 1 deletion actions/setup/js/create_issue.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ async function main(config = {}) {
createdIssues.push({ ...issue, _repo: qualifiedItemRepo });

// Store the mapping of temporary_id -> {repo, number}
temporaryIdMap.set(normalizeTemporaryId(temporaryId), { repo: qualifiedItemRepo, number: issue.number });
// temporaryId is guaranteed to be non-null because we checked tempIdResult.error above
const normalizedTempId = normalizeTemporaryId(String(temporaryId));
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The String() wrapper is redundant because normalizeTemporaryId() already calls String() internally on its parameter (see temporary_id.cjs line 53). This means the string conversion happens twice.

While this doesn't change runtime behavior, it adds unnecessary code. Since the temporaryId variable at line 321 already has a JSDoc type cast to string, and there's an early return if tempIdResult.error is truthy (lines 313-318), the TypeScript type checker should recognize that temporaryId is non-null at this point.

If TypeScript's control flow analysis isn't recognizing the JSDoc cast, a more idiomatic solution would be to add a runtime check (e.g., if (!temporaryId) throw new Error(...)) or use a non-null assertion if you're confident about the guarantee. The redundant String() call works but masks the underlying type narrowing issue.

Suggested change
const normalizedTempId = normalizeTemporaryId(String(temporaryId));
const normalizedTempId = normalizeTemporaryId(temporaryId);

Copilot uses AI. Check for mistakes.
temporaryIdMap.set(normalizedTempId, { repo: qualifiedItemRepo, number: issue.number });
core.info(`Stored temporary ID mapping: ${temporaryId} -> ${qualifiedItemRepo}#${issue.number}`);

// Track issue for copilot assignment if needed
Expand Down
Loading