MCPcopy Create free account
hub / github.com/github/gh-aw / loadTemporaryProjectMap

Function loadTemporaryProjectMap

actions/setup/js/temporary_id.cjs:583–606  ·  view source on GitHub ↗

* Load the temporary project map from environment variable * @returns {Map } Map of temporary_project_id to project URL

()

Source from the content-addressed store, hash-verified

581 * @returns {Map<string, string>} Map of temporary_project_id to project URL
582 */
583function loadTemporaryProjectMap() {
584 const mapJson = process.env.GH_AW_TEMPORARY_PROJECT_MAP;
585 if (!mapJson || mapJson === "{}") {
586 return new Map();
587 }
588 try {
589 const mapObject = JSON.parse(mapJson);
590 /** @type {Map<string, string>} */
591 const result = new Map();
592
593 for (const [key, value] of Object.entries(mapObject)) {
594 const normalizedKey = normalizeTemporaryId(key);
595 if (typeof value === "string") {
596 result.set(normalizedKey, value);
597 }
598 }
599 return result;
600 } catch (error) {
601 if (typeof core !== "undefined") {
602 core.warning(`Failed to parse temporary project map: ${getErrorMessage(error)}`);
603 }
604 return new Map();
605 }
606}
607
608/**
609 * Replace temporary project ID references in text with actual project URLs

Callers 2

executeIssueUpdateFunction · 0.85

Calls 3

normalizeTemporaryIdFunction · 0.85
getErrorMessageFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected