* Finds the summary file path from the environment, rejects if env var is not found or file does not exist * Also checks r/w permissions. * * @returns step summary file path
()
| 19561 | * @returns step summary file path |
| 19562 | */ |
| 19563 | filePath() { |
| 19564 | return __awaiter(this, void 0, void 0, function* () { |
| 19565 | if (this._filePath) { |
| 19566 | return this._filePath; |
| 19567 | } |
| 19568 | const pathFromEnv = process.env[SUMMARY_ENV_VAR]; |
| 19569 | if (!pathFromEnv) { |
| 19570 | throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); |
| 19571 | } |
| 19572 | try { |
| 19573 | yield access(pathFromEnv, import_fs.constants.R_OK | import_fs.constants.W_OK); |
| 19574 | } catch (_a) { |
| 19575 | throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); |
| 19576 | } |
| 19577 | this._filePath = pathFromEnv; |
| 19578 | return this._filePath; |
| 19579 | }); |
| 19580 | } |
| 19581 | /** |
| 19582 | * Wraps content in an HTML tag, adding any HTML attributes |
| 19583 | * |