* Load the temporary project map from environment variable * @returns {Map } Map of temporary_project_id to project URL
()
| 581 | * @returns {Map<string, string>} Map of temporary_project_id to project URL |
| 582 | */ |
| 583 | function 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 |
no test coverage detected