mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-03-14 06:50:10 +08:00
add create tree with output data
This commit is contained in:
parent
cb8703f3ca
commit
a5b12ae628
401
dist/cleanup/index.js
generated
vendored
401
dist/cleanup/index.js
generated
vendored
@ -57237,314 +57237,6 @@ function isPlainObject(o) {
|
|||||||
exports.isPlainObject = isPlainObject;
|
exports.isPlainObject = isPlainObject;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 7821:
|
|
||||||
/***/ (function(module) {
|
|
||||||
|
|
||||||
//
|
|
||||||
// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
|
|
||||||
//
|
|
||||||
;
|
|
||||||
(function (global, factory) {
|
|
||||||
true
|
|
||||||
? module.exports = factory()
|
|
||||||
: 0;
|
|
||||||
}((typeof self !== 'undefined' ? self
|
|
||||||
: typeof window !== 'undefined' ? window
|
|
||||||
: typeof global !== 'undefined' ? global
|
|
||||||
: this), function () {
|
|
||||||
'use strict';
|
|
||||||
/**
|
|
||||||
* base64.ts
|
|
||||||
*
|
|
||||||
* Licensed under the BSD 3-Clause License.
|
|
||||||
* http://opensource.org/licenses/BSD-3-Clause
|
|
||||||
*
|
|
||||||
* References:
|
|
||||||
* http://en.wikipedia.org/wiki/Base64
|
|
||||||
*
|
|
||||||
* @author Dan Kogai (https://github.com/dankogai)
|
|
||||||
*/
|
|
||||||
var version = '3.7.5';
|
|
||||||
/**
|
|
||||||
* @deprecated use lowercase `version`.
|
|
||||||
*/
|
|
||||||
var VERSION = version;
|
|
||||||
var _hasatob = typeof atob === 'function';
|
|
||||||
var _hasbtoa = typeof btoa === 'function';
|
|
||||||
var _hasBuffer = typeof Buffer === 'function';
|
|
||||||
var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
||||||
var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
||||||
var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
||||||
var b64chs = Array.prototype.slice.call(b64ch);
|
|
||||||
var b64tab = (function (a) {
|
|
||||||
var tab = {};
|
|
||||||
a.forEach(function (c, i) { return tab[c] = i; });
|
|
||||||
return tab;
|
|
||||||
})(b64chs);
|
|
||||||
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
||||||
var _fromCC = String.fromCharCode.bind(String);
|
|
||||||
var _U8Afrom = typeof Uint8Array.from === 'function'
|
|
||||||
? Uint8Array.from.bind(Uint8Array)
|
|
||||||
: function (it) { return new Uint8Array(Array.prototype.slice.call(it, 0)); };
|
|
||||||
var _mkUriSafe = function (src) { return src
|
|
||||||
.replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
|
|
||||||
var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
|
|
||||||
/**
|
|
||||||
* polyfill version of `btoa`
|
|
||||||
*/
|
|
||||||
var btoaPolyfill = function (bin) {
|
|
||||||
// console.log('polyfilled');
|
|
||||||
var u32, c0, c1, c2, asc = '';
|
|
||||||
var pad = bin.length % 3;
|
|
||||||
for (var i = 0; i < bin.length;) {
|
|
||||||
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
||||||
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
||||||
(c2 = bin.charCodeAt(i++)) > 255)
|
|
||||||
throw new TypeError('invalid character found');
|
|
||||||
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
||||||
asc += b64chs[u32 >> 18 & 63]
|
|
||||||
+ b64chs[u32 >> 12 & 63]
|
|
||||||
+ b64chs[u32 >> 6 & 63]
|
|
||||||
+ b64chs[u32 & 63];
|
|
||||||
}
|
|
||||||
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* does what `window.btoa` of web browsers do.
|
|
||||||
* @param {String} bin binary string
|
|
||||||
* @returns {string} Base64-encoded string
|
|
||||||
*/
|
|
||||||
var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }
|
|
||||||
: _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }
|
|
||||||
: btoaPolyfill;
|
|
||||||
var _fromUint8Array = _hasBuffer
|
|
||||||
? function (u8a) { return Buffer.from(u8a).toString('base64'); }
|
|
||||||
: function (u8a) {
|
|
||||||
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
||||||
var maxargs = 0x1000;
|
|
||||||
var strs = [];
|
|
||||||
for (var i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
||||||
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
||||||
}
|
|
||||||
return _btoa(strs.join(''));
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* converts a Uint8Array to a Base64 string.
|
|
||||||
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
||||||
* @returns {string} Base64 string
|
|
||||||
*/
|
|
||||||
var fromUint8Array = function (u8a, urlsafe) {
|
|
||||||
if (urlsafe === void 0) { urlsafe = false; }
|
|
||||||
return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
||||||
};
|
|
||||||
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
||||||
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
||||||
// reverting good old fationed regexp
|
|
||||||
var cb_utob = function (c) {
|
|
||||||
if (c.length < 2) {
|
|
||||||
var cc = c.charCodeAt(0);
|
|
||||||
return cc < 0x80 ? c
|
|
||||||
: cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
|
|
||||||
+ _fromCC(0x80 | (cc & 0x3f)))
|
|
||||||
: (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
|
|
||||||
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
||||||
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var cc = 0x10000
|
|
||||||
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
||||||
+ (c.charCodeAt(1) - 0xDC00);
|
|
||||||
return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
|
|
||||||
+ _fromCC(0x80 | ((cc >>> 12) & 0x3f))
|
|
||||||
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
||||||
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
||||||
/**
|
|
||||||
* @deprecated should have been internal use only.
|
|
||||||
* @param {string} src UTF-8 string
|
|
||||||
* @returns {string} UTF-16 string
|
|
||||||
*/
|
|
||||||
var utob = function (u) { return u.replace(re_utob, cb_utob); };
|
|
||||||
//
|
|
||||||
var _encode = _hasBuffer
|
|
||||||
? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }
|
|
||||||
: _TE
|
|
||||||
? function (s) { return _fromUint8Array(_TE.encode(s)); }
|
|
||||||
: function (s) { return _btoa(utob(s)); };
|
|
||||||
/**
|
|
||||||
* converts a UTF-8-encoded string to a Base64 string.
|
|
||||||
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
||||||
* @returns {string} Base64 string
|
|
||||||
*/
|
|
||||||
var encode = function (src, urlsafe) {
|
|
||||||
if (urlsafe === void 0) { urlsafe = false; }
|
|
||||||
return urlsafe
|
|
||||||
? _mkUriSafe(_encode(src))
|
|
||||||
: _encode(src);
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
||||||
* @returns {string} Base64 string
|
|
||||||
*/
|
|
||||||
var encodeURI = function (src) { return encode(src, true); };
|
|
||||||
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
||||||
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
||||||
// reverting good old fationed regexp
|
|
||||||
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
||||||
var cb_btou = function (cccc) {
|
|
||||||
switch (cccc.length) {
|
|
||||||
case 4:
|
|
||||||
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
||||||
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
||||||
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
||||||
| (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
|
|
||||||
return (_fromCC((offset >>> 10) + 0xD800)
|
|
||||||
+ _fromCC((offset & 0x3FF) + 0xDC00));
|
|
||||||
case 3:
|
|
||||||
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
|
|
||||||
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
||||||
| (0x3f & cccc.charCodeAt(2)));
|
|
||||||
default:
|
|
||||||
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
|
|
||||||
| (0x3f & cccc.charCodeAt(1)));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @deprecated should have been internal use only.
|
|
||||||
* @param {string} src UTF-16 string
|
|
||||||
* @returns {string} UTF-8 string
|
|
||||||
*/
|
|
||||||
var btou = function (b) { return b.replace(re_btou, cb_btou); };
|
|
||||||
/**
|
|
||||||
* polyfill version of `atob`
|
|
||||||
*/
|
|
||||||
var atobPolyfill = function (asc) {
|
|
||||||
// console.log('polyfilled');
|
|
||||||
asc = asc.replace(/\s+/g, '');
|
|
||||||
if (!b64re.test(asc))
|
|
||||||
throw new TypeError('malformed base64.');
|
|
||||||
asc += '=='.slice(2 - (asc.length & 3));
|
|
||||||
var u24, bin = '', r1, r2;
|
|
||||||
for (var i = 0; i < asc.length;) {
|
|
||||||
u24 = b64tab[asc.charAt(i++)] << 18
|
|
||||||
| b64tab[asc.charAt(i++)] << 12
|
|
||||||
| (r1 = b64tab[asc.charAt(i++)]) << 6
|
|
||||||
| (r2 = b64tab[asc.charAt(i++)]);
|
|
||||||
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
|
|
||||||
: r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
|
|
||||||
: _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
|
|
||||||
}
|
|
||||||
return bin;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* does what `window.atob` of web browsers do.
|
|
||||||
* @param {String} asc Base64-encoded string
|
|
||||||
* @returns {string} binary string
|
|
||||||
*/
|
|
||||||
var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }
|
|
||||||
: _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }
|
|
||||||
: atobPolyfill;
|
|
||||||
//
|
|
||||||
var _toUint8Array = _hasBuffer
|
|
||||||
? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }
|
|
||||||
: function (a) { return _U8Afrom(_atob(a).split('').map(function (c) { return c.charCodeAt(0); })); };
|
|
||||||
/**
|
|
||||||
* converts a Base64 string to a Uint8Array.
|
|
||||||
*/
|
|
||||||
var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };
|
|
||||||
//
|
|
||||||
var _decode = _hasBuffer
|
|
||||||
? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }
|
|
||||||
: _TD
|
|
||||||
? function (a) { return _TD.decode(_toUint8Array(a)); }
|
|
||||||
: function (a) { return btou(_atob(a)); };
|
|
||||||
var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };
|
|
||||||
/**
|
|
||||||
* converts a Base64 string to a UTF-8 string.
|
|
||||||
* @param {String} src Base64 string. Both normal and URL-safe are supported
|
|
||||||
* @returns {string} UTF-8 string
|
|
||||||
*/
|
|
||||||
var decode = function (src) { return _decode(_unURI(src)); };
|
|
||||||
/**
|
|
||||||
* check if a value is a valid Base64 string
|
|
||||||
* @param {String} src a value to check
|
|
||||||
*/
|
|
||||||
var isValid = function (src) {
|
|
||||||
if (typeof src !== 'string')
|
|
||||||
return false;
|
|
||||||
var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
|
|
||||||
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
|
|
||||||
};
|
|
||||||
//
|
|
||||||
var _noEnum = function (v) {
|
|
||||||
return {
|
|
||||||
value: v, enumerable: false, writable: true, configurable: true
|
|
||||||
};
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* extend String.prototype with relevant methods
|
|
||||||
*/
|
|
||||||
var extendString = function () {
|
|
||||||
var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };
|
|
||||||
_add('fromBase64', function () { return decode(this); });
|
|
||||||
_add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
|
|
||||||
_add('toBase64URI', function () { return encode(this, true); });
|
|
||||||
_add('toBase64URL', function () { return encode(this, true); });
|
|
||||||
_add('toUint8Array', function () { return toUint8Array(this); });
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* extend Uint8Array.prototype with relevant methods
|
|
||||||
*/
|
|
||||||
var extendUint8Array = function () {
|
|
||||||
var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };
|
|
||||||
_add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
|
|
||||||
_add('toBase64URI', function () { return fromUint8Array(this, true); });
|
|
||||||
_add('toBase64URL', function () { return fromUint8Array(this, true); });
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* extend Builtin prototypes with relevant methods
|
|
||||||
*/
|
|
||||||
var extendBuiltins = function () {
|
|
||||||
extendString();
|
|
||||||
extendUint8Array();
|
|
||||||
};
|
|
||||||
var gBase64 = {
|
|
||||||
version: version,
|
|
||||||
VERSION: VERSION,
|
|
||||||
atob: _atob,
|
|
||||||
atobPolyfill: atobPolyfill,
|
|
||||||
btoa: _btoa,
|
|
||||||
btoaPolyfill: btoaPolyfill,
|
|
||||||
fromBase64: decode,
|
|
||||||
toBase64: encode,
|
|
||||||
encode: encode,
|
|
||||||
encodeURI: encodeURI,
|
|
||||||
encodeURL: encodeURI,
|
|
||||||
utob: utob,
|
|
||||||
btou: btou,
|
|
||||||
decode: decode,
|
|
||||||
isValid: isValid,
|
|
||||||
fromUint8Array: fromUint8Array,
|
|
||||||
toUint8Array: toUint8Array,
|
|
||||||
extendString: extendString,
|
|
||||||
extendUint8Array: extendUint8Array,
|
|
||||||
extendBuiltins: extendBuiltins
|
|
||||||
};
|
|
||||||
//
|
|
||||||
// export Base64 to the namespace
|
|
||||||
//
|
|
||||||
// ES5 is yet to have Object.assign() that may make transpilers unhappy.
|
|
||||||
// gBase64.Base64 = Object.assign({}, gBase64);
|
|
||||||
gBase64.Base64 = {};
|
|
||||||
Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });
|
|
||||||
return gBase64;
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 8401:
|
/***/ 8401:
|
||||||
@ -74451,7 +74143,8 @@ function generateReports() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
||||||
(0, utils_1.saveReportJson)(JSON.stringify(buildOutput));
|
const treeSha = yield (0, utils_1.createTree)(JSON.stringify(buildOutput));
|
||||||
|
yield (0, utils_1.createRef)(treeSha);
|
||||||
const report = createReport(buildOutput);
|
const report = createReport(buildOutput);
|
||||||
if (areJobReportsEnabled()) {
|
if (areJobReportsEnabled()) {
|
||||||
core.summary.addRaw(report);
|
core.summary.addRaw(report);
|
||||||
@ -74753,11 +74446,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.saveReportJson = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
exports.createTree = exports.createRef = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
||||||
const c = __importStar(__nccwpck_require__(2764));
|
const c = __importStar(__nccwpck_require__(2764));
|
||||||
const core = __importStar(__nccwpck_require__(2258));
|
const core = __importStar(__nccwpck_require__(2258));
|
||||||
const github = __importStar(__nccwpck_require__(7168));
|
const github = __importStar(__nccwpck_require__(7168));
|
||||||
@ -74768,8 +74458,6 @@ const fs_1 = __nccwpck_require__(7147);
|
|||||||
//import {Octokit} from '@octokit/core'
|
//import {Octokit} from '@octokit/core'
|
||||||
const crypto_1 = __nccwpck_require__(6113);
|
const crypto_1 = __nccwpck_require__(6113);
|
||||||
const path_1 = __nccwpck_require__(1017);
|
const path_1 = __nccwpck_require__(1017);
|
||||||
const node_fetch_1 = __importDefault(__nccwpck_require__(831));
|
|
||||||
const js_base64_1 = __nccwpck_require__(7821);
|
|
||||||
const rest_1 = __nccwpck_require__(6175);
|
const rest_1 = __nccwpck_require__(6175);
|
||||||
// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP)
|
// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP)
|
||||||
const baseUrl = 'https://api.github.com';
|
const baseUrl = 'https://api.github.com';
|
||||||
@ -74898,6 +74586,9 @@ exports.isPREvent = isPREvent;
|
|||||||
function getGitHubToken() {
|
function getGitHubToken() {
|
||||||
return core.getInput(c.INPUT_GITHUB_TOKEN);
|
return core.getInput(c.INPUT_GITHUB_TOKEN);
|
||||||
}
|
}
|
||||||
|
function getCommitSha() {
|
||||||
|
return process.env.GITHUB_SHA || "default_tag";
|
||||||
|
}
|
||||||
function createPRComment(content) {
|
function createPRComment(content) {
|
||||||
var _a;
|
var _a;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@ -74914,34 +74605,70 @@ function createPRComment(content) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.createPRComment = createPRComment;
|
exports.createPRComment = createPRComment;
|
||||||
function saveReportJson(content) {
|
/*export async function saveReportJson(content: string): Promise<void> {
|
||||||
|
const octokit = new Octokit({
|
||||||
|
auth: getGitHubToken(),
|
||||||
|
request: {
|
||||||
|
fetch: fetch,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const contentEncoded = Base64.encode(content)
|
||||||
|
|
||||||
|
|
||||||
|
const { data } = await octokit.repos.createOrUpdateFileContents({
|
||||||
|
owner: 'jessiscript',
|
||||||
|
repo: 're23_build_tracking',
|
||||||
|
path: 'OUTPUT.json',
|
||||||
|
content: contentEncoded,
|
||||||
|
message: 'Add Report JSON data',
|
||||||
|
committer: {
|
||||||
|
name: 'jessiscript',
|
||||||
|
email: 'pauljessica2001@gmail.com',
|
||||||
|
},
|
||||||
|
author:{
|
||||||
|
name: 'jessiscript',
|
||||||
|
email: 'pauljessica2001@gmail.com',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
}*/
|
||||||
|
function createRef(sha) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const commitSha = getCommitSha();
|
||||||
|
const ref = `refs/metrics/${commitSha}`;
|
||||||
|
console.log(`creating ref ${ref} for metrics tree ${sha}`);
|
||||||
|
const octokit = new rest_1.Octokit({
|
||||||
|
auth: getGitHubToken(),
|
||||||
|
});
|
||||||
|
const context = github.context;
|
||||||
|
const response = yield octokit.request(`POST /repos/${context.repo.owner}/${context.repo.repo}/git/refs`, Object.assign(Object.assign({}, context.repo), { ref,
|
||||||
|
sha }));
|
||||||
|
console.log(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.createRef = createRef;
|
||||||
|
function createTree(metadataJson) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const octokit = new rest_1.Octokit({
|
const octokit = new rest_1.Octokit({
|
||||||
auth: getGitHubToken(),
|
auth: getGitHubToken(),
|
||||||
request: {
|
|
||||||
fetch: node_fetch_1.default,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const contentEncoded = js_base64_1.Base64.encode(content);
|
const context = github.context;
|
||||||
const { data } = yield octokit.repos.createOrUpdateFileContents({
|
console.log(`creating tree at ${context.repo.owner}/${context.repo.repo}`);
|
||||||
owner: 'jessiscript',
|
const response = yield octokit.request(`POST /repos/${context.repo.owner}/${context.repo.repo}/git/trees`, Object.assign(Object.assign({}, context.repo), { tree: [
|
||||||
repo: 're23_build_tracking',
|
{
|
||||||
path: 'OUTPUT.json',
|
path: "metadataJson",
|
||||||
content: contentEncoded,
|
mode: "100644",
|
||||||
message: 'Add Report JSON data',
|
type: "blob",
|
||||||
committer: {
|
content: metadataJson,
|
||||||
name: 'jessiscript',
|
},
|
||||||
email: 'pauljessica2001@gmail.com',
|
] }));
|
||||||
},
|
console.log(response);
|
||||||
author: {
|
return response.data.sha;
|
||||||
name: 'jessiscript',
|
|
||||||
email: 'pauljessica2001@gmail.com',
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log(data);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.saveReportJson = saveReportJson;
|
exports.createTree = createTree;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
401
dist/main/index.js
generated
vendored
401
dist/main/index.js
generated
vendored
@ -57237,314 +57237,6 @@ function isPlainObject(o) {
|
|||||||
exports.isPlainObject = isPlainObject;
|
exports.isPlainObject = isPlainObject;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 7821:
|
|
||||||
/***/ (function(module) {
|
|
||||||
|
|
||||||
//
|
|
||||||
// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
|
|
||||||
//
|
|
||||||
;
|
|
||||||
(function (global, factory) {
|
|
||||||
true
|
|
||||||
? module.exports = factory()
|
|
||||||
: 0;
|
|
||||||
}((typeof self !== 'undefined' ? self
|
|
||||||
: typeof window !== 'undefined' ? window
|
|
||||||
: typeof global !== 'undefined' ? global
|
|
||||||
: this), function () {
|
|
||||||
'use strict';
|
|
||||||
/**
|
|
||||||
* base64.ts
|
|
||||||
*
|
|
||||||
* Licensed under the BSD 3-Clause License.
|
|
||||||
* http://opensource.org/licenses/BSD-3-Clause
|
|
||||||
*
|
|
||||||
* References:
|
|
||||||
* http://en.wikipedia.org/wiki/Base64
|
|
||||||
*
|
|
||||||
* @author Dan Kogai (https://github.com/dankogai)
|
|
||||||
*/
|
|
||||||
var version = '3.7.5';
|
|
||||||
/**
|
|
||||||
* @deprecated use lowercase `version`.
|
|
||||||
*/
|
|
||||||
var VERSION = version;
|
|
||||||
var _hasatob = typeof atob === 'function';
|
|
||||||
var _hasbtoa = typeof btoa === 'function';
|
|
||||||
var _hasBuffer = typeof Buffer === 'function';
|
|
||||||
var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
||||||
var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
||||||
var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
||||||
var b64chs = Array.prototype.slice.call(b64ch);
|
|
||||||
var b64tab = (function (a) {
|
|
||||||
var tab = {};
|
|
||||||
a.forEach(function (c, i) { return tab[c] = i; });
|
|
||||||
return tab;
|
|
||||||
})(b64chs);
|
|
||||||
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
||||||
var _fromCC = String.fromCharCode.bind(String);
|
|
||||||
var _U8Afrom = typeof Uint8Array.from === 'function'
|
|
||||||
? Uint8Array.from.bind(Uint8Array)
|
|
||||||
: function (it) { return new Uint8Array(Array.prototype.slice.call(it, 0)); };
|
|
||||||
var _mkUriSafe = function (src) { return src
|
|
||||||
.replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
|
|
||||||
var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
|
|
||||||
/**
|
|
||||||
* polyfill version of `btoa`
|
|
||||||
*/
|
|
||||||
var btoaPolyfill = function (bin) {
|
|
||||||
// console.log('polyfilled');
|
|
||||||
var u32, c0, c1, c2, asc = '';
|
|
||||||
var pad = bin.length % 3;
|
|
||||||
for (var i = 0; i < bin.length;) {
|
|
||||||
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
||||||
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
||||||
(c2 = bin.charCodeAt(i++)) > 255)
|
|
||||||
throw new TypeError('invalid character found');
|
|
||||||
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
||||||
asc += b64chs[u32 >> 18 & 63]
|
|
||||||
+ b64chs[u32 >> 12 & 63]
|
|
||||||
+ b64chs[u32 >> 6 & 63]
|
|
||||||
+ b64chs[u32 & 63];
|
|
||||||
}
|
|
||||||
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* does what `window.btoa` of web browsers do.
|
|
||||||
* @param {String} bin binary string
|
|
||||||
* @returns {string} Base64-encoded string
|
|
||||||
*/
|
|
||||||
var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }
|
|
||||||
: _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }
|
|
||||||
: btoaPolyfill;
|
|
||||||
var _fromUint8Array = _hasBuffer
|
|
||||||
? function (u8a) { return Buffer.from(u8a).toString('base64'); }
|
|
||||||
: function (u8a) {
|
|
||||||
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
||||||
var maxargs = 0x1000;
|
|
||||||
var strs = [];
|
|
||||||
for (var i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
||||||
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
||||||
}
|
|
||||||
return _btoa(strs.join(''));
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* converts a Uint8Array to a Base64 string.
|
|
||||||
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
||||||
* @returns {string} Base64 string
|
|
||||||
*/
|
|
||||||
var fromUint8Array = function (u8a, urlsafe) {
|
|
||||||
if (urlsafe === void 0) { urlsafe = false; }
|
|
||||||
return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
||||||
};
|
|
||||||
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
||||||
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
||||||
// reverting good old fationed regexp
|
|
||||||
var cb_utob = function (c) {
|
|
||||||
if (c.length < 2) {
|
|
||||||
var cc = c.charCodeAt(0);
|
|
||||||
return cc < 0x80 ? c
|
|
||||||
: cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
|
|
||||||
+ _fromCC(0x80 | (cc & 0x3f)))
|
|
||||||
: (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
|
|
||||||
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
||||||
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var cc = 0x10000
|
|
||||||
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
||||||
+ (c.charCodeAt(1) - 0xDC00);
|
|
||||||
return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
|
|
||||||
+ _fromCC(0x80 | ((cc >>> 12) & 0x3f))
|
|
||||||
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
||||||
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
||||||
/**
|
|
||||||
* @deprecated should have been internal use only.
|
|
||||||
* @param {string} src UTF-8 string
|
|
||||||
* @returns {string} UTF-16 string
|
|
||||||
*/
|
|
||||||
var utob = function (u) { return u.replace(re_utob, cb_utob); };
|
|
||||||
//
|
|
||||||
var _encode = _hasBuffer
|
|
||||||
? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }
|
|
||||||
: _TE
|
|
||||||
? function (s) { return _fromUint8Array(_TE.encode(s)); }
|
|
||||||
: function (s) { return _btoa(utob(s)); };
|
|
||||||
/**
|
|
||||||
* converts a UTF-8-encoded string to a Base64 string.
|
|
||||||
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
||||||
* @returns {string} Base64 string
|
|
||||||
*/
|
|
||||||
var encode = function (src, urlsafe) {
|
|
||||||
if (urlsafe === void 0) { urlsafe = false; }
|
|
||||||
return urlsafe
|
|
||||||
? _mkUriSafe(_encode(src))
|
|
||||||
: _encode(src);
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
||||||
* @returns {string} Base64 string
|
|
||||||
*/
|
|
||||||
var encodeURI = function (src) { return encode(src, true); };
|
|
||||||
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
||||||
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
||||||
// reverting good old fationed regexp
|
|
||||||
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
||||||
var cb_btou = function (cccc) {
|
|
||||||
switch (cccc.length) {
|
|
||||||
case 4:
|
|
||||||
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
||||||
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
||||||
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
||||||
| (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
|
|
||||||
return (_fromCC((offset >>> 10) + 0xD800)
|
|
||||||
+ _fromCC((offset & 0x3FF) + 0xDC00));
|
|
||||||
case 3:
|
|
||||||
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
|
|
||||||
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
||||||
| (0x3f & cccc.charCodeAt(2)));
|
|
||||||
default:
|
|
||||||
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
|
|
||||||
| (0x3f & cccc.charCodeAt(1)));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @deprecated should have been internal use only.
|
|
||||||
* @param {string} src UTF-16 string
|
|
||||||
* @returns {string} UTF-8 string
|
|
||||||
*/
|
|
||||||
var btou = function (b) { return b.replace(re_btou, cb_btou); };
|
|
||||||
/**
|
|
||||||
* polyfill version of `atob`
|
|
||||||
*/
|
|
||||||
var atobPolyfill = function (asc) {
|
|
||||||
// console.log('polyfilled');
|
|
||||||
asc = asc.replace(/\s+/g, '');
|
|
||||||
if (!b64re.test(asc))
|
|
||||||
throw new TypeError('malformed base64.');
|
|
||||||
asc += '=='.slice(2 - (asc.length & 3));
|
|
||||||
var u24, bin = '', r1, r2;
|
|
||||||
for (var i = 0; i < asc.length;) {
|
|
||||||
u24 = b64tab[asc.charAt(i++)] << 18
|
|
||||||
| b64tab[asc.charAt(i++)] << 12
|
|
||||||
| (r1 = b64tab[asc.charAt(i++)]) << 6
|
|
||||||
| (r2 = b64tab[asc.charAt(i++)]);
|
|
||||||
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
|
|
||||||
: r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
|
|
||||||
: _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
|
|
||||||
}
|
|
||||||
return bin;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* does what `window.atob` of web browsers do.
|
|
||||||
* @param {String} asc Base64-encoded string
|
|
||||||
* @returns {string} binary string
|
|
||||||
*/
|
|
||||||
var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }
|
|
||||||
: _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }
|
|
||||||
: atobPolyfill;
|
|
||||||
//
|
|
||||||
var _toUint8Array = _hasBuffer
|
|
||||||
? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }
|
|
||||||
: function (a) { return _U8Afrom(_atob(a).split('').map(function (c) { return c.charCodeAt(0); })); };
|
|
||||||
/**
|
|
||||||
* converts a Base64 string to a Uint8Array.
|
|
||||||
*/
|
|
||||||
var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };
|
|
||||||
//
|
|
||||||
var _decode = _hasBuffer
|
|
||||||
? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }
|
|
||||||
: _TD
|
|
||||||
? function (a) { return _TD.decode(_toUint8Array(a)); }
|
|
||||||
: function (a) { return btou(_atob(a)); };
|
|
||||||
var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };
|
|
||||||
/**
|
|
||||||
* converts a Base64 string to a UTF-8 string.
|
|
||||||
* @param {String} src Base64 string. Both normal and URL-safe are supported
|
|
||||||
* @returns {string} UTF-8 string
|
|
||||||
*/
|
|
||||||
var decode = function (src) { return _decode(_unURI(src)); };
|
|
||||||
/**
|
|
||||||
* check if a value is a valid Base64 string
|
|
||||||
* @param {String} src a value to check
|
|
||||||
*/
|
|
||||||
var isValid = function (src) {
|
|
||||||
if (typeof src !== 'string')
|
|
||||||
return false;
|
|
||||||
var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
|
|
||||||
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
|
|
||||||
};
|
|
||||||
//
|
|
||||||
var _noEnum = function (v) {
|
|
||||||
return {
|
|
||||||
value: v, enumerable: false, writable: true, configurable: true
|
|
||||||
};
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* extend String.prototype with relevant methods
|
|
||||||
*/
|
|
||||||
var extendString = function () {
|
|
||||||
var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };
|
|
||||||
_add('fromBase64', function () { return decode(this); });
|
|
||||||
_add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
|
|
||||||
_add('toBase64URI', function () { return encode(this, true); });
|
|
||||||
_add('toBase64URL', function () { return encode(this, true); });
|
|
||||||
_add('toUint8Array', function () { return toUint8Array(this); });
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* extend Uint8Array.prototype with relevant methods
|
|
||||||
*/
|
|
||||||
var extendUint8Array = function () {
|
|
||||||
var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };
|
|
||||||
_add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
|
|
||||||
_add('toBase64URI', function () { return fromUint8Array(this, true); });
|
|
||||||
_add('toBase64URL', function () { return fromUint8Array(this, true); });
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* extend Builtin prototypes with relevant methods
|
|
||||||
*/
|
|
||||||
var extendBuiltins = function () {
|
|
||||||
extendString();
|
|
||||||
extendUint8Array();
|
|
||||||
};
|
|
||||||
var gBase64 = {
|
|
||||||
version: version,
|
|
||||||
VERSION: VERSION,
|
|
||||||
atob: _atob,
|
|
||||||
atobPolyfill: atobPolyfill,
|
|
||||||
btoa: _btoa,
|
|
||||||
btoaPolyfill: btoaPolyfill,
|
|
||||||
fromBase64: decode,
|
|
||||||
toBase64: encode,
|
|
||||||
encode: encode,
|
|
||||||
encodeURI: encodeURI,
|
|
||||||
encodeURL: encodeURI,
|
|
||||||
utob: utob,
|
|
||||||
btou: btou,
|
|
||||||
decode: decode,
|
|
||||||
isValid: isValid,
|
|
||||||
fromUint8Array: fromUint8Array,
|
|
||||||
toUint8Array: toUint8Array,
|
|
||||||
extendString: extendString,
|
|
||||||
extendUint8Array: extendUint8Array,
|
|
||||||
extendBuiltins: extendBuiltins
|
|
||||||
};
|
|
||||||
//
|
|
||||||
// export Base64 to the namespace
|
|
||||||
//
|
|
||||||
// ES5 is yet to have Object.assign() that may make transpilers unhappy.
|
|
||||||
// gBase64.Base64 = Object.assign({}, gBase64);
|
|
||||||
gBase64.Base64 = {};
|
|
||||||
Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });
|
|
||||||
return gBase64;
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 8401:
|
/***/ 8401:
|
||||||
@ -74550,7 +74242,8 @@ function generateReports() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
||||||
(0, utils_1.saveReportJson)(JSON.stringify(buildOutput));
|
const treeSha = yield (0, utils_1.createTree)(JSON.stringify(buildOutput));
|
||||||
|
yield (0, utils_1.createRef)(treeSha);
|
||||||
const report = createReport(buildOutput);
|
const report = createReport(buildOutput);
|
||||||
if (areJobReportsEnabled()) {
|
if (areJobReportsEnabled()) {
|
||||||
core.summary.addRaw(report);
|
core.summary.addRaw(report);
|
||||||
@ -75750,11 +75443,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.saveReportJson = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
exports.createTree = exports.createRef = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
||||||
const c = __importStar(__nccwpck_require__(2764));
|
const c = __importStar(__nccwpck_require__(2764));
|
||||||
const core = __importStar(__nccwpck_require__(2258));
|
const core = __importStar(__nccwpck_require__(2258));
|
||||||
const github = __importStar(__nccwpck_require__(7168));
|
const github = __importStar(__nccwpck_require__(7168));
|
||||||
@ -75765,8 +75455,6 @@ const fs_1 = __nccwpck_require__(7147);
|
|||||||
//import {Octokit} from '@octokit/core'
|
//import {Octokit} from '@octokit/core'
|
||||||
const crypto_1 = __nccwpck_require__(6113);
|
const crypto_1 = __nccwpck_require__(6113);
|
||||||
const path_1 = __nccwpck_require__(1017);
|
const path_1 = __nccwpck_require__(1017);
|
||||||
const node_fetch_1 = __importDefault(__nccwpck_require__(831));
|
|
||||||
const js_base64_1 = __nccwpck_require__(7821);
|
|
||||||
const rest_1 = __nccwpck_require__(6175);
|
const rest_1 = __nccwpck_require__(6175);
|
||||||
// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP)
|
// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP)
|
||||||
const baseUrl = 'https://api.github.com';
|
const baseUrl = 'https://api.github.com';
|
||||||
@ -75895,6 +75583,9 @@ exports.isPREvent = isPREvent;
|
|||||||
function getGitHubToken() {
|
function getGitHubToken() {
|
||||||
return core.getInput(c.INPUT_GITHUB_TOKEN);
|
return core.getInput(c.INPUT_GITHUB_TOKEN);
|
||||||
}
|
}
|
||||||
|
function getCommitSha() {
|
||||||
|
return process.env.GITHUB_SHA || "default_tag";
|
||||||
|
}
|
||||||
function createPRComment(content) {
|
function createPRComment(content) {
|
||||||
var _a;
|
var _a;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@ -75911,34 +75602,70 @@ function createPRComment(content) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.createPRComment = createPRComment;
|
exports.createPRComment = createPRComment;
|
||||||
function saveReportJson(content) {
|
/*export async function saveReportJson(content: string): Promise<void> {
|
||||||
|
const octokit = new Octokit({
|
||||||
|
auth: getGitHubToken(),
|
||||||
|
request: {
|
||||||
|
fetch: fetch,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const contentEncoded = Base64.encode(content)
|
||||||
|
|
||||||
|
|
||||||
|
const { data } = await octokit.repos.createOrUpdateFileContents({
|
||||||
|
owner: 'jessiscript',
|
||||||
|
repo: 're23_build_tracking',
|
||||||
|
path: 'OUTPUT.json',
|
||||||
|
content: contentEncoded,
|
||||||
|
message: 'Add Report JSON data',
|
||||||
|
committer: {
|
||||||
|
name: 'jessiscript',
|
||||||
|
email: 'pauljessica2001@gmail.com',
|
||||||
|
},
|
||||||
|
author:{
|
||||||
|
name: 'jessiscript',
|
||||||
|
email: 'pauljessica2001@gmail.com',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
}*/
|
||||||
|
function createRef(sha) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const commitSha = getCommitSha();
|
||||||
|
const ref = `refs/metrics/${commitSha}`;
|
||||||
|
console.log(`creating ref ${ref} for metrics tree ${sha}`);
|
||||||
|
const octokit = new rest_1.Octokit({
|
||||||
|
auth: getGitHubToken(),
|
||||||
|
});
|
||||||
|
const context = github.context;
|
||||||
|
const response = yield octokit.request(`POST /repos/${context.repo.owner}/${context.repo.repo}/git/refs`, Object.assign(Object.assign({}, context.repo), { ref,
|
||||||
|
sha }));
|
||||||
|
console.log(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.createRef = createRef;
|
||||||
|
function createTree(metadataJson) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const octokit = new rest_1.Octokit({
|
const octokit = new rest_1.Octokit({
|
||||||
auth: getGitHubToken(),
|
auth: getGitHubToken(),
|
||||||
request: {
|
|
||||||
fetch: node_fetch_1.default,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const contentEncoded = js_base64_1.Base64.encode(content);
|
const context = github.context;
|
||||||
const { data } = yield octokit.repos.createOrUpdateFileContents({
|
console.log(`creating tree at ${context.repo.owner}/${context.repo.repo}`);
|
||||||
owner: 'jessiscript',
|
const response = yield octokit.request(`POST /repos/${context.repo.owner}/${context.repo.repo}/git/trees`, Object.assign(Object.assign({}, context.repo), { tree: [
|
||||||
repo: 're23_build_tracking',
|
{
|
||||||
path: 'OUTPUT.json',
|
path: "metadataJson",
|
||||||
content: contentEncoded,
|
mode: "100644",
|
||||||
message: 'Add Report JSON data',
|
type: "blob",
|
||||||
committer: {
|
content: metadataJson,
|
||||||
name: 'jessiscript',
|
},
|
||||||
email: 'pauljessica2001@gmail.com',
|
] }));
|
||||||
},
|
console.log(response);
|
||||||
author: {
|
return response.data.sha;
|
||||||
name: 'jessiscript',
|
|
||||||
email: 'pauljessica2001@gmail.com',
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log(data);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.saveReportJson = saveReportJson;
|
exports.createTree = createTree;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -4,7 +4,7 @@ import * as fs from 'fs'
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import {join} from 'path'
|
import {join} from 'path'
|
||||||
import {tmpdir} from 'os'
|
import {tmpdir} from 'os'
|
||||||
import {createPRComment, isPREvent, saveReportJson, toSemVer} from '../utils'
|
import {createPRComment, createRef, createTree, isPREvent, toSemVer} from '../utils'
|
||||||
import {gte} from 'semver'
|
import {gte} from 'semver'
|
||||||
import {Base64} from 'js-base64';
|
import {Base64} from 'js-base64';
|
||||||
import { Octokit } from '@octokit/rest';
|
import { Octokit } from '@octokit/rest';
|
||||||
@ -134,7 +134,8 @@ export async function generateReports(): Promise<void> {
|
|||||||
fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8')
|
fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8')
|
||||||
)
|
)
|
||||||
|
|
||||||
saveReportJson(JSON.stringify(buildOutput))
|
const treeSha = await createTree(JSON.stringify(buildOutput))
|
||||||
|
await createRef(treeSha)
|
||||||
|
|
||||||
const report = createReport(buildOutput)
|
const report = createReport(buildOutput)
|
||||||
if (areJobReportsEnabled()) {
|
if (areJobReportsEnabled()) {
|
||||||
|
54
src/utils.ts
54
src/utils.ts
@ -159,6 +159,10 @@ function getGitHubToken(): string {
|
|||||||
return core.getInput(c.INPUT_GITHUB_TOKEN)
|
return core.getInput(c.INPUT_GITHUB_TOKEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCommitSha(): string {
|
||||||
|
return process.env.GITHUB_SHA || "default_tag"
|
||||||
|
}
|
||||||
|
|
||||||
export async function createPRComment(content: string): Promise<void> {
|
export async function createPRComment(content: string): Promise<void> {
|
||||||
if (!isPREvent()) {
|
if (!isPREvent()) {
|
||||||
throw new Error('Not a PR event.')
|
throw new Error('Not a PR event.')
|
||||||
@ -177,7 +181,7 @@ export async function createPRComment(content: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveReportJson(content: string): Promise<void> {
|
/*export async function saveReportJson(content: string): Promise<void> {
|
||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
auth: getGitHubToken(),
|
auth: getGitHubToken(),
|
||||||
request: {
|
request: {
|
||||||
@ -205,4 +209,52 @@ export async function saveReportJson(content: string): Promise<void> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
export async function createRef(sha: string) {
|
||||||
|
const commitSha = getCommitSha()
|
||||||
|
const ref = `refs/metrics/${commitSha}`
|
||||||
|
console.log(`creating ref ${ref} for metrics tree ${sha}`);
|
||||||
|
const octokit = new Octokit({
|
||||||
|
auth: getGitHubToken(),
|
||||||
|
});
|
||||||
|
const context = github.context
|
||||||
|
|
||||||
|
const response = await octokit.request(
|
||||||
|
`POST /repos/${context.repo.owner}/${context.repo.repo}/git/refs`,
|
||||||
|
{
|
||||||
|
...context.repo,
|
||||||
|
ref,
|
||||||
|
sha,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createTree(metadataJson: string): Promise<string> {
|
||||||
|
const octokit = new Octokit({
|
||||||
|
auth: getGitHubToken(),
|
||||||
|
});
|
||||||
|
const context = github.context
|
||||||
|
|
||||||
|
console.log(`creating tree at ${context.repo.owner}/${context.repo.repo}`);
|
||||||
|
|
||||||
|
const response = await octokit.request(
|
||||||
|
`POST /repos/${context.repo.owner}/${context.repo.repo}/git/trees`,
|
||||||
|
{
|
||||||
|
...context.repo,
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
path: "metadataJson",
|
||||||
|
mode: "100644",
|
||||||
|
type: "blob",
|
||||||
|
content: metadataJson,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(response);
|
||||||
|
return response.data.sha;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user