@@ -416,10 +416,15 @@ function getIDToken(aud) {
416416}
417417exports.getIDToken = getIDToken;
418418/**
419- * Markdown summary exports
419+ * Summary exports
420420 */
421- var markdown_summary_1 = __nccwpck_require__(8042);
422- Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return markdown_summary_1.markdownSummary; } }));
421+ var summary_1 = __nccwpck_require__(1327);
422+ Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
423+ /**
424+ * @deprecated use core.summary
425+ */
426+ var summary_2 = __nccwpck_require__(1327);
427+ Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
423428//# sourceMappingURL=core.js.map
424429
425430/***/ }),
@@ -473,7 +478,91 @@ exports.issueCommand = issueCommand;
473478
474479/***/ }),
475480
476- /***/ 8042:
481+ /***/ 8041:
482+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
483+
484+ "use strict";
485+
486+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
487+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
488+ return new (P || (P = Promise))(function (resolve, reject) {
489+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
490+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
491+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
492+ step((generator = generator.apply(thisArg, _arguments || [])).next());
493+ });
494+ };
495+ Object.defineProperty(exports, "__esModule", ({ value: true }));
496+ exports.OidcClient = void 0;
497+ const http_client_1 = __nccwpck_require__(9925);
498+ const auth_1 = __nccwpck_require__(3702);
499+ const core_1 = __nccwpck_require__(2186);
500+ class OidcClient {
501+ static createHttpClient(allowRetry = true, maxRetry = 10) {
502+ const requestOptions = {
503+ allowRetries: allowRetry,
504+ maxRetries: maxRetry
505+ };
506+ return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
507+ }
508+ static getRequestToken() {
509+ const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
510+ if (!token) {
511+ throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
512+ }
513+ return token;
514+ }
515+ static getIDTokenUrl() {
516+ const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
517+ if (!runtimeUrl) {
518+ throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
519+ }
520+ return runtimeUrl;
521+ }
522+ static getCall(id_token_url) {
523+ var _a;
524+ return __awaiter(this, void 0, void 0, function* () {
525+ const httpclient = OidcClient.createHttpClient();
526+ const res = yield httpclient
527+ .getJson(id_token_url)
528+ .catch(error => {
529+ throw new Error(`Failed to get ID Token. \n
530+ Error Code : ${error.statusCode}\n
531+ Error Message: ${error.result.message}`);
532+ });
533+ const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
534+ if (!id_token) {
535+ throw new Error('Response json body do not have ID Token field');
536+ }
537+ return id_token;
538+ });
539+ }
540+ static getIDToken(audience) {
541+ return __awaiter(this, void 0, void 0, function* () {
542+ try {
543+ // New ID Token is requested from action service
544+ let id_token_url = OidcClient.getIDTokenUrl();
545+ if (audience) {
546+ const encodedAudience = encodeURIComponent(audience);
547+ id_token_url = `${id_token_url}&audience=${encodedAudience}`;
548+ }
549+ core_1.debug(`ID token url is ${id_token_url}`);
550+ const id_token = yield OidcClient.getCall(id_token_url);
551+ core_1.setSecret(id_token);
552+ return id_token;
553+ }
554+ catch (error) {
555+ throw new Error(`Error message: ${error.message}`);
556+ }
557+ });
558+ }
559+ }
560+ exports.OidcClient = OidcClient;
561+ //# sourceMappingURL=oidc-utils.js.map
562+
563+ /***/ }),
564+
565+ /***/ 1327:
477566/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
478567
479568"use strict";
@@ -488,13 +577,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
488577 });
489578};
490579Object.defineProperty(exports, "__esModule", ({ value: true }));
491- exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
580+ exports.summary = exports. markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
492581const os_1 = __nccwpck_require__(2037);
493582const fs_1 = __nccwpck_require__(7147);
494583const { access, appendFile, writeFile } = fs_1.promises;
495584exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
496- exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown -summary';
497- class MarkdownSummary {
585+ exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job -summary';
586+ class Summary {
498587 constructor() {
499588 this._buffer = '';
500589 }
@@ -511,7 +600,7 @@ class MarkdownSummary {
511600 }
512601 const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
513602 if (!pathFromEnv) {
514- throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports markdown summaries.`);
603+ throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
515604 }
516605 try {
517606 yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
@@ -546,7 +635,7 @@ class MarkdownSummary {
546635 *
547636 * @param {SummaryWriteOptions} [options] (optional) options for write operation
548637 *
549- * @returns {Promise<MarkdownSummary>} markdown summary instance
638+ * @returns {Promise<Summary>} summary instance
550639 */
551640 write(options) {
552641 return __awaiter(this, void 0, void 0, function* () {
@@ -560,7 +649,7 @@ class MarkdownSummary {
560649 /**
561650 * Clears the summary buffer and wipes the summary file
562651 *
563- * @returns {MarkdownSummary} markdown summary instance
652+ * @returns {Summary} summary instance
564653 */
565654 clear() {
566655 return __awaiter(this, void 0, void 0, function* () {
@@ -586,7 +675,7 @@ class MarkdownSummary {
586675 /**
587676 * Resets the summary buffer without writing to summary file
588677 *
589- * @returns {MarkdownSummary} markdown summary instance
678+ * @returns {Summary} summary instance
590679 */
591680 emptyBuffer() {
592681 this._buffer = '';
@@ -598,7 +687,7 @@ class MarkdownSummary {
598687 * @param {string} text content to add
599688 * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
600689 *
601- * @returns {MarkdownSummary} markdown summary instance
690+ * @returns {Summary} summary instance
602691 */
603692 addRaw(text, addEOL = false) {
604693 this._buffer += text;
@@ -607,7 +696,7 @@ class MarkdownSummary {
607696 /**
608697 * Adds the operating system-specific end-of-line marker to the buffer
609698 *
610- * @returns {MarkdownSummary} markdown summary instance
699+ * @returns {Summary} summary instance
611700 */
612701 addEOL() {
613702 return this.addRaw(os_1.EOL);
@@ -618,7 +707,7 @@ class MarkdownSummary {
618707 * @param {string} code content to render within fenced code block
619708 * @param {string} lang (optional) language to syntax highlight code
620709 *
621- * @returns {MarkdownSummary} markdown summary instance
710+ * @returns {Summary} summary instance
622711 */
623712 addCodeBlock(code, lang) {
624713 const attrs = Object.assign({}, (lang && { lang }));
@@ -631,7 +720,7 @@ class MarkdownSummary {
631720 * @param {string[]} items list of items to render
632721 * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
633722 *
634- * @returns {MarkdownSummary} markdown summary instance
723+ * @returns {Summary} summary instance
635724 */
636725 addList(items, ordered = false) {
637726 const tag = ordered ? 'ol' : 'ul';
@@ -644,7 +733,7 @@ class MarkdownSummary {
644733 *
645734 * @param {SummaryTableCell[]} rows table rows
646735 *
647- * @returns {MarkdownSummary} markdown summary instance
736+ * @returns {Summary} summary instance
648737 */
649738 addTable(rows) {
650739 const tableBody = rows
@@ -672,7 +761,7 @@ class MarkdownSummary {
672761 * @param {string} label text for the closed state
673762 * @param {string} content collapsable content
674763 *
675- * @returns {MarkdownSummary} markdown summary instance
764+ * @returns {Summary} summary instance
676765 */
677766 addDetails(label, content) {
678767 const element = this.wrap('details', this.wrap('summary', label) + content);
@@ -685,7 +774,7 @@ class MarkdownSummary {
685774 * @param {string} alt text description of the image
686775 * @param {SummaryImageOptions} options (optional) addition image attributes
687776 *
688- * @returns {MarkdownSummary} markdown summary instance
777+ * @returns {Summary} summary instance
689778 */
690779 addImage(src, alt, options) {
691780 const { width, height } = options || {};
@@ -699,7 +788,7 @@ class MarkdownSummary {
699788 * @param {string} text heading text
700789 * @param {number | string} [level=1] (optional) the heading level, default: 1
701790 *
702- * @returns {MarkdownSummary} markdown summary instance
791+ * @returns {Summary} summary instance
703792 */
704793 addHeading(text, level) {
705794 const tag = `h${level}`;
@@ -712,7 +801,7 @@ class MarkdownSummary {
712801 /**
713802 * Adds an HTML thematic break (<hr>) to the summary buffer
714803 *
715- * @returns {MarkdownSummary} markdown summary instance
804+ * @returns {Summary} summary instance
716805 */
717806 addSeparator() {
718807 const element = this.wrap('hr', null);
@@ -721,7 +810,7 @@ class MarkdownSummary {
721810 /**
722811 * Adds an HTML line break (<br>) to the summary buffer
723812 *
724- * @returns {MarkdownSummary} markdown summary instance
813+ * @returns {Summary} summary instance
725814 */
726815 addBreak() {
727816 const element = this.wrap('br', null);
@@ -733,7 +822,7 @@ class MarkdownSummary {
733822 * @param {string} text quote text
734823 * @param {string} cite (optional) citation url
735824 *
736- * @returns {MarkdownSummary} markdown summary instance
825+ * @returns {Summary} summary instance
737826 */
738827 addQuote(text, cite) {
739828 const attrs = Object.assign({}, (cite && { cite }));
@@ -746,100 +835,20 @@ class MarkdownSummary {
746835 * @param {string} text link text/content
747836 * @param {string} href hyperlink
748837 *
749- * @returns {MarkdownSummary} markdown summary instance
838+ * @returns {Summary} summary instance
750839 */
751840 addLink(text, href) {
752841 const element = this.wrap('a', text, { href });
753842 return this.addRaw(element).addEOL();
754843 }
755844}
756- // singleton export
757- exports.markdownSummary = new MarkdownSummary();
758- //# sourceMappingURL=markdown-summary.js.map
759-
760- /***/ }),
761-
762- /***/ 8041:
763- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
764-
765- "use strict";
766-
767- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
768- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
769- return new (P || (P = Promise))(function (resolve, reject) {
770- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
771- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
772- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
773- step((generator = generator.apply(thisArg, _arguments || [])).next());
774- });
775- };
776- Object.defineProperty(exports, "__esModule", ({ value: true }));
777- exports.OidcClient = void 0;
778- const http_client_1 = __nccwpck_require__(9925);
779- const auth_1 = __nccwpck_require__(3702);
780- const core_1 = __nccwpck_require__(2186);
781- class OidcClient {
782- static createHttpClient(allowRetry = true, maxRetry = 10) {
783- const requestOptions = {
784- allowRetries: allowRetry,
785- maxRetries: maxRetry
786- };
787- return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
788- }
789- static getRequestToken() {
790- const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
791- if (!token) {
792- throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
793- }
794- return token;
795- }
796- static getIDTokenUrl() {
797- const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
798- if (!runtimeUrl) {
799- throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
800- }
801- return runtimeUrl;
802- }
803- static getCall(id_token_url) {
804- var _a;
805- return __awaiter(this, void 0, void 0, function* () {
806- const httpclient = OidcClient.createHttpClient();
807- const res = yield httpclient
808- .getJson(id_token_url)
809- .catch(error => {
810- throw new Error(`Failed to get ID Token. \n
811- Error Code : ${error.statusCode}\n
812- Error Message: ${error.result.message}`);
813- });
814- const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
815- if (!id_token) {
816- throw new Error('Response json body do not have ID Token field');
817- }
818- return id_token;
819- });
820- }
821- static getIDToken(audience) {
822- return __awaiter(this, void 0, void 0, function* () {
823- try {
824- // New ID Token is requested from action service
825- let id_token_url = OidcClient.getIDTokenUrl();
826- if (audience) {
827- const encodedAudience = encodeURIComponent(audience);
828- id_token_url = `${id_token_url}&audience=${encodedAudience}`;
829- }
830- core_1.debug(`ID token url is ${id_token_url}`);
831- const id_token = yield OidcClient.getCall(id_token_url);
832- core_1.setSecret(id_token);
833- return id_token;
834- }
835- catch (error) {
836- throw new Error(`Error message: ${error.message}`);
837- }
838- });
839- }
840- }
841- exports.OidcClient = OidcClient;
842- //# sourceMappingURL=oidc-utils.js.map
845+ const _summary = new Summary();
846+ /**
847+ * @deprecated use `core.summary`
848+ */
849+ exports.markdownSummary = _summary;
850+ exports.summary = _summary;
851+ //# sourceMappingURL=summary.js.map
843852
844853/***/ }),
845854
0 commit comments