From 222f614d0e8a75067bce751ed2bad6c039322471 Mon Sep 17 00:00:00 2001 From: Mogyuchi Date: Fri, 27 Sep 2024 09:00:26 +0900 Subject: [PATCH] refactor: switch to ES modules (#250) --- dist/index.js | 995 +++++++++++----------------------------------- dist/package.json | 3 + package.json | 7 +- src/index.ts | 2 +- src/main.ts | 6 +- src/ref.ts | 6 +- 6 files changed, 248 insertions(+), 771 deletions(-) create mode 100644 dist/package.json diff --git a/dist/index.js b/dist/index.js index 0185eec..aaecca1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,10 +1,9 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ +import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; +/******/ var __webpack_modules__ = ({ /***/ 579: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -103,7 +102,6 @@ function escapeProperty(s) { /***/ 7627: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -446,7 +444,6 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ 4742: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -511,7 +508,6 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ 1257: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -595,7 +591,6 @@ exports.OidcClient = OidcClient; /***/ 6879: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -660,7 +655,6 @@ exports.toPlatformPath = toPlatformPath; /***/ 8402: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -950,7 +944,6 @@ exports.summary = _summary; /***/ 3431: /***/ ((__unused_webpack_module, exports) => { -"use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -997,7 +990,6 @@ exports.toCommandProperties = toCommandProperties; /***/ 878: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; @@ -1059,7 +1051,6 @@ exports.Context = Context; /***/ 3802: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1107,7 +1098,6 @@ exports.getOctokit = getOctokit; /***/ 4294: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1184,7 +1174,6 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ 1516: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1250,7 +1239,6 @@ exports.getOctokitOptions = getOctokitOptions; /***/ 5916: /***/ (function(__unused_webpack_module, exports) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -1338,7 +1326,6 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ 7952: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -1997,7 +1984,6 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ 9504: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.checkBypass = exports.getProxyUrl = void 0; @@ -2099,7 +2085,6 @@ class DecodedURL extends URL { /***/ 1437: /***/ ((module) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -2184,7 +2169,6 @@ var createTokenAuth = function createTokenAuth2(token) { /***/ 9968: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -2353,7 +2337,6 @@ var Octokit = class { /***/ 6267: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -2737,7 +2720,6 @@ var endpoint = withDefaults(null, DEFAULTS); /***/ 4839: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -2895,7 +2877,6 @@ function withCustomRequest(customRequest) { /***/ 4146: /***/ ((module) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -3296,7 +3277,6 @@ paginateRest.VERSION = VERSION; /***/ 1756: /***/ ((module) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -5466,7 +5446,6 @@ legacyRestEndpointMethods.VERSION = VERSION; /***/ 2637: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; @@ -5564,7 +5543,6 @@ var RequestError = class extends Error { /***/ 6125: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -5975,7 +5953,6 @@ function removeHook(state, name, method) { /***/ 6933: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -6060,7 +6037,6 @@ module.exports = __nccwpck_require__(4125); /***/ 4125: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; var net = __nccwpck_require__(9278); @@ -6332,7 +6308,6 @@ exports.debug = debug; // for test /***/ 4860: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Client = __nccwpck_require__(4673) @@ -6507,7 +6482,6 @@ module.exports.mockErrors = mockErrors /***/ 4081: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { InvalidArgumentError } = __nccwpck_require__(575) @@ -6724,7 +6698,6 @@ module.exports = { /***/ 7440: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { AsyncResource } = __nccwpck_require__(290) @@ -6836,7 +6809,6 @@ module.exports = connect /***/ 26: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -7093,7 +7065,6 @@ module.exports = pipeline /***/ 8031: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Readable = __nccwpck_require__(987) @@ -7281,7 +7252,6 @@ module.exports.RequestHandler = RequestHandler /***/ 1996: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { finished, PassThrough } = __nccwpck_require__(2203) @@ -7509,7 +7479,6 @@ module.exports = stream /***/ 9566: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(575) @@ -7622,7 +7591,6 @@ module.exports = upgrade /***/ 8763: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports.request = __nccwpck_require__(8031) @@ -7637,7 +7605,6 @@ module.exports.connect = __nccwpck_require__(7440) /***/ 987: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // Ported from https://github.com/nodejs/undici/pull/907 @@ -8020,7 +7987,6 @@ module.exports = { getResolveErrorBodyCallback } /***/ 5481: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -8218,7 +8184,6 @@ module.exports = BalancedPool /***/ 6955: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kConstruct } = __nccwpck_require__(5412) @@ -9064,7 +9029,6 @@ module.exports = { /***/ 5574: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kConstruct } = __nccwpck_require__(5412) @@ -9216,7 +9180,6 @@ module.exports = { /***/ 5412: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports = { @@ -9229,7 +9192,6 @@ module.exports = { /***/ 1293: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -9286,7 +9248,6 @@ module.exports = { /***/ 4673: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // @ts-check @@ -11577,7 +11538,6 @@ module.exports = Client /***/ 3070: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* istanbul ignore file: only for Node 12 */ @@ -11633,7 +11593,6 @@ module.exports = function () { /***/ 4721: /***/ ((module) => { -"use strict"; // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size @@ -11653,7 +11612,6 @@ module.exports = { /***/ 3756: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { parseSetCookie } = __nccwpck_require__(9359) @@ -11845,7 +11803,6 @@ module.exports = { /***/ 9359: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(4721) @@ -12170,7 +12127,6 @@ module.exports = { /***/ 3374: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -12469,7 +12425,6 @@ module.exports = { /***/ 5500: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const net = __nccwpck_require__(9278) @@ -12666,7 +12621,6 @@ module.exports = buildConnector /***/ 1291: /***/ ((module) => { -"use strict"; /** @type {Record} */ @@ -12792,7 +12746,6 @@ module.exports = { /***/ 575: /***/ ((module) => { -"use strict"; class UndiciError extends Error { @@ -13030,7 +12983,6 @@ module.exports = { /***/ 8147: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -13607,7 +13559,6 @@ module.exports = { /***/ 532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -14137,7 +14088,6 @@ module.exports = { /***/ 9869: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Dispatcher = __nccwpck_require__(2711) @@ -14337,7 +14287,6 @@ module.exports = DispatcherBase /***/ 2711: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const EventEmitter = __nccwpck_require__(4434) @@ -14364,7 +14313,6 @@ module.exports = Dispatcher /***/ 855: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Busboy = __nccwpck_require__(8819) @@ -14977,7 +14925,6 @@ module.exports = { /***/ 7418: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(8167) @@ -15770,7 +15717,6 @@ module.exports = { /***/ 133: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Blob, File: NativeFile } = __nccwpck_require__(181) @@ -16122,7 +16068,6 @@ module.exports = { File, FileLike, isFileLike } /***/ 3813: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(7495) @@ -16395,7 +16340,6 @@ module.exports = { FormData } /***/ 1896: /***/ ((module) => { -"use strict"; // In case of breaking changes, increase the version @@ -16443,7 +16387,6 @@ module.exports = { /***/ 265: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // https://github.com/Ethan-Arrowood/undici-fetch @@ -17040,7 +16983,6 @@ module.exports = { /***/ 5799: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // https://github.com/Ethan-Arrowood/undici-fetch @@ -19196,7 +19138,6 @@ module.exports = { /***/ 3406: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* globals AbortController */ @@ -20150,7 +20091,6 @@ module.exports = { Request, makeRequest } /***/ 7488: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Headers, HeadersList, fill } = __nccwpck_require__(265) @@ -20729,7 +20669,6 @@ module.exports = { /***/ 3610: /***/ ((module) => { -"use strict"; module.exports = { @@ -20747,7 +20686,6 @@ module.exports = { /***/ 7495: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(7418) @@ -21899,7 +21837,6 @@ module.exports = { /***/ 1994: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { types } = __nccwpck_require__(9023) @@ -22553,7 +22490,6 @@ module.exports = { /***/ 9064: /***/ ((module) => { -"use strict"; /** @@ -22851,7 +22787,6 @@ module.exports = { /***/ 2764: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -23203,7 +23138,6 @@ module.exports = { /***/ 9932: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(1994) @@ -23289,7 +23223,6 @@ module.exports = { /***/ 8904: /***/ ((module) => { -"use strict"; module.exports = { @@ -23307,7 +23240,6 @@ module.exports = { /***/ 4041: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -23707,7 +23639,6 @@ module.exports = { /***/ 4001: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // We include a version number for the Dispatcher API. In case of breaking changes, @@ -23747,7 +23678,6 @@ module.exports = { /***/ 7140: /***/ ((module) => { -"use strict"; module.exports = class DecoratorHandler { @@ -23790,7 +23720,6 @@ module.exports = class DecoratorHandler { /***/ 903: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const util = __nccwpck_require__(532) @@ -24362,7 +24291,6 @@ module.exports = RetryHandler /***/ 379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const RedirectHandler = __nccwpck_require__(903) @@ -24391,7 +24319,6 @@ module.exports = createRedirectInterceptor /***/ 9188: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; @@ -24692,7 +24619,6 @@ module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn /***/ 6424: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.enumToMap = void 0; @@ -24714,7 +24640,6 @@ exports.enumToMap = enumToMap; /***/ 1777: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kClients } = __nccwpck_require__(4871) @@ -24893,7 +24818,6 @@ module.exports = MockAgent /***/ 7073: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { promisify } = __nccwpck_require__(9023) @@ -24960,7 +24884,6 @@ module.exports = MockClient /***/ 9705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { UndiciError } = __nccwpck_require__(575) @@ -24985,7 +24908,6 @@ module.exports = { /***/ 6683: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(1) @@ -25199,7 +25121,6 @@ module.exports.MockScope = MockScope /***/ 2712: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { promisify } = __nccwpck_require__(9023) @@ -25266,7 +25187,6 @@ module.exports = MockPool /***/ 233: /***/ ((module) => { -"use strict"; module.exports = { @@ -25297,7 +25217,6 @@ module.exports = { /***/ 1: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { MockNotMatchedError } = __nccwpck_require__(9705) @@ -25656,7 +25575,6 @@ module.exports = { /***/ 2466: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Transform } = __nccwpck_require__(2203) @@ -25704,7 +25622,6 @@ module.exports = class PendingInterceptorsFormatter { /***/ 5893: /***/ ((module) => { -"use strict"; const singulars = { @@ -25741,7 +25658,6 @@ module.exports = class Pluralizer { /***/ 9625: /***/ ((module) => { -"use strict"; /* eslint-disable */ @@ -25866,7 +25782,6 @@ module.exports = class FixedQueue { /***/ 9852: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const DispatcherBase = __nccwpck_require__(9869) @@ -26109,7 +26024,6 @@ module.exports = PoolStats /***/ 9960: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -26211,7 +26125,6 @@ module.exports = Pool /***/ 1108: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(4871) @@ -26408,7 +26321,6 @@ module.exports = ProxyAgent /***/ 4552: /***/ ((module) => { -"use strict"; let fastNow = Date.now() @@ -26513,7 +26425,6 @@ module.exports = { /***/ 1162: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const diagnosticsChannel = __nccwpck_require__(1637) @@ -26812,7 +26723,6 @@ module.exports = { /***/ 9189: /***/ ((module) => { -"use strict"; // This is a Globally Unique Identifier unique used @@ -26871,7 +26781,6 @@ module.exports = { /***/ 9779: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(1994) @@ -27182,7 +27091,6 @@ module.exports = { /***/ 3841: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { maxUnsigned16Bit } = __nccwpck_require__(9189) @@ -27263,7 +27171,6 @@ module.exports = { /***/ 2287: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Writable } = __nccwpck_require__(2203) @@ -27615,7 +27522,6 @@ module.exports = { /***/ 7265: /***/ ((module) => { -"use strict"; module.exports = { @@ -27635,7 +27541,6 @@ module.exports = { /***/ 7386: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7265) @@ -27843,7 +27748,6 @@ module.exports = { /***/ 9647: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(1994) @@ -28492,7 +28396,6 @@ module.exports = { /***/ 3168: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -28518,7 +28421,6 @@ exports.getUserAgent = getUserAgent; /***/ 1987: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28604,7 +28506,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ 1563: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28634,7 +28535,6 @@ exports["default"] = _default; /***/ 8500: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28649,7 +28549,6 @@ exports["default"] = _default; /***/ 2156: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28701,7 +28600,6 @@ exports["default"] = _default; /***/ 5276: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28716,7 +28614,6 @@ exports["default"] = _default; /***/ 8070: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28747,7 +28644,6 @@ function rng() { /***/ 8678: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28777,7 +28673,6 @@ exports["default"] = _default; /***/ 9362: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28823,7 +28718,6 @@ exports["default"] = _default; /***/ 4986: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28937,7 +28831,6 @@ exports["default"] = _default; /***/ 7840: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -28960,7 +28853,6 @@ exports["default"] = _default; /***/ 9981: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -29045,7 +28937,6 @@ function _default(name, version, hashfunc) { /***/ 7221: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -29089,7 +28980,6 @@ exports["default"] = _default; /***/ 9030: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -29112,7 +29002,6 @@ exports["default"] = _default; /***/ 7961: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -29136,7 +29025,6 @@ exports["default"] = _default; /***/ 1691: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -29199,484 +29087,207 @@ function wrappy (fn, cb) { } -/***/ }), - -/***/ 2280: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInputs = void 0; -const core = __importStar(__nccwpck_require__(7627)); -const getInputs = () => ({ - token: core.getInput('repo-token', { required: true }), - branchNames: core - .getInput('branch-names') - .split(/\s+/) - .filter(x => x !== ''), - dryRun: core.getBooleanInput('dry-run') -}); -exports.getInputs = getInputs; - - -/***/ }), - -/***/ 9053: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.convertRef = void 0; -const convertRef = (str, { refType }) => { - if (str === null || str === undefined) - return null; - if (str.startsWith('refs/')) - return str; - switch (refType) { - case 'branch': - return `refs/heads/${str}`; - case 'tag': - return `refs/tags/${str}`; - case 'pull': - return `refs/pull/${str}/merge`; - } -}; -exports.convertRef = convertRef; - - -/***/ }), - -/***/ 7855: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.run = run; -const core = __importStar(__nccwpck_require__(7627)); -const github = __importStar(__nccwpck_require__(3802)); -const ref_1 = __nccwpck_require__(937); -const get_inputs_1 = __nccwpck_require__(2280); -const utils_1 = __nccwpck_require__(9053); -const ansi = { reset: '\x1B[0m', dryRun: '\x1B[38;2;90;185;255m' }; -const prefix = ({ isDryRun = false }) => isDryRun ? `${ansi.dryRun}DRY-RUN MODE ${ansi.reset}` : ''; -const deleteRefActionsCaches = async (octokit, repo, ref, isDryRun) => { - const deleteCache = async (cache) => { - if (!cache.id) - return; - core.info(`${prefix({ isDryRun })} - Cache with key ${cache.key}`); - if (!isDryRun) { - await octokit.rest.actions.deleteActionsCacheById({ - ...repo, - cache_id: cache.id - }); - } - }; - // https://github.com/octokit/plugin-paginate-rest.js#octokitpaginate - const caches = await octokit.paginate(octokit.rest.actions.getActionsCacheList, { - ...repo, - ref, - per_page: 100 - }); - core.startGroup(`${prefix({ isDryRun })}⌛ Deleting ${caches.length} cache(s) on ${ref}`); - await Promise.all(caches.map(async (cache) => deleteCache(cache))); - core.endGroup(); -}; -/** - * The main function for the action. - * @returns {Promise} Resolves when the action is complete. - */ -async function run() { - try { - const { token, branchNames, dryRun: isDryRun } = (0, get_inputs_1.getInputs)(); - const octokit = github.getOctokit(token); - // get repostiory information - const { repo, eventName, payload } = github.context; - const infoNull = (name) => { - core.info(`🤔 Could not determine deletion target: ${name}`); - core.info('ℹī¸ If you suspect this is a bug, please consider raising an issue to help us address it promptly.'); - return []; - }; - const refs = branchNames.length === 0 - ? [(0, ref_1.getRef)({ eventName, payload })].flatMap(x => x ? x : infoNull(eventName)) - : branchNames - .map(branchName => (0, utils_1.convertRef)(branchName, { refType: 'branch' })) - .filter(ref => ref !== null); - for (const ref of refs) { - await deleteRefActionsCaches(octokit, repo, ref, isDryRun); - } - core.info(`${prefix({ isDryRun })}✅ Done`); - } - catch (error) { - // Fail the workflow run if an error occurs - if (error instanceof Error) { - core.setFailed(error.message); - core.info('ℹī¸ If you suspect this is a bug, please consider raising an issue to help us address it promptly.'); - } - } -} - - -/***/ }), - -/***/ 1625: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.nullableStringParser = exports.optionalStringParser = exports.stringParser = void 0; -const valibot_1 = __nccwpck_require__(5949); -const StringSchema = (0, valibot_1.string)(); -const OptionalStringSchema = (0, valibot_1.optional)((0, valibot_1.string)()); -const NullableStringSchema = (0, valibot_1.nullable)((0, valibot_1.string)()); -exports.stringParser = (0, valibot_1.parser)(StringSchema); -exports.optionalStringParser = (0, valibot_1.parser)(OptionalStringSchema); -exports.nullableStringParser = (0, valibot_1.parser)(NullableStringSchema); - - -/***/ }), - -/***/ 937: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRef = void 0; -const parser_1 = __nccwpck_require__(1625); -const utils_1 = __nccwpck_require__(9053); -const getRef = ({ eventName, payload }) => { - switch (eventName) { - case 'check_run': - return (0, utils_1.convertRef)((0, parser_1.nullableStringParser)(payload.check_run.check_suite.head_branch), { refType: 'branch' }); - case 'check_suite': - return (0, utils_1.convertRef)((0, parser_1.nullableStringParser)(payload.check_suite.head_branch), { - refType: 'branch' - }); - case 'create': - case 'delete': - return (0, utils_1.convertRef)((0, parser_1.nullableStringParser)(payload.ref), { - refType: payload.ref_type - }); - case 'deployment_status': - return (0, utils_1.convertRef)((0, parser_1.optionalStringParser)(payload.workflow_run?.head_branch), { - refType: 'branch' - }); - case 'issue_comment': - return (0, utils_1.convertRef)((0, parser_1.stringParser)(payload.issue?.number.toString()), { - refType: 'pull' - }); - case 'merge_group': - return (0, parser_1.stringParser)(payload.merge_group.head_ref); - case 'pull_request': - case 'pull_request_review': - case 'pull_request_review_comment': - case 'pull_request_target': - return (0, utils_1.convertRef)(payload.pull_request?.number.toString(), { - refType: 'pull' - }); - case 'push': - return (0, parser_1.stringParser)(payload.ref); - case 'registry_package': - return (0, utils_1.convertRef)((0, parser_1.optionalStringParser)(payload.registry_package?.package_version?.release?.tag_name), { - refType: 'tag' - }); - case 'release': - return (0, utils_1.convertRef)((0, parser_1.stringParser)(payload.release.tag_name), { - refType: 'tag' - }); - case 'workflow_dispatch': - return (0, parser_1.stringParser)(payload.ref); - case 'workflow_run': - return (0, utils_1.convertRef)((0, parser_1.nullableStringParser)(payload.workflow_run.head_branch), { - refType: 'branch' - }); - default: - throw new Error(`${eventName} event is not supported.`); - } -}; -exports.getRef = getRef; - - /***/ }), /***/ 2613: /***/ ((module) => { -"use strict"; -module.exports = require("assert"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); /***/ }), /***/ 290: /***/ ((module) => { -"use strict"; -module.exports = require("async_hooks"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks"); /***/ }), /***/ 181: /***/ ((module) => { -"use strict"; -module.exports = require("buffer"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer"); /***/ }), /***/ 4236: /***/ ((module) => { -"use strict"; -module.exports = require("console"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); /***/ }), /***/ 6982: /***/ ((module) => { -"use strict"; -module.exports = require("crypto"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); /***/ }), /***/ 1637: /***/ ((module) => { -"use strict"; -module.exports = require("diagnostics_channel"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("diagnostics_channel"); /***/ }), /***/ 4434: /***/ ((module) => { -"use strict"; -module.exports = require("events"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); /***/ }), /***/ 9896: /***/ ((module) => { -"use strict"; -module.exports = require("fs"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); /***/ }), /***/ 8611: /***/ ((module) => { -"use strict"; -module.exports = require("http"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); /***/ }), /***/ 5675: /***/ ((module) => { -"use strict"; -module.exports = require("http2"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2"); /***/ }), /***/ 5692: /***/ ((module) => { -"use strict"; -module.exports = require("https"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); /***/ }), /***/ 9278: /***/ ((module) => { -"use strict"; -module.exports = require("net"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); /***/ }), /***/ 8474: /***/ ((module) => { -"use strict"; -module.exports = require("node:events"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"); /***/ }), /***/ 7075: /***/ ((module) => { -"use strict"; -module.exports = require("node:stream"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream"); /***/ }), /***/ 7975: /***/ ((module) => { -"use strict"; -module.exports = require("node:util"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util"); /***/ }), /***/ 857: /***/ ((module) => { -"use strict"; -module.exports = require("os"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); /***/ }), /***/ 6928: /***/ ((module) => { -"use strict"; -module.exports = require("path"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); /***/ }), /***/ 2987: /***/ ((module) => { -"use strict"; -module.exports = require("perf_hooks"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("perf_hooks"); /***/ }), /***/ 3480: /***/ ((module) => { -"use strict"; -module.exports = require("querystring"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring"); /***/ }), /***/ 2203: /***/ ((module) => { -"use strict"; -module.exports = require("stream"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); /***/ }), /***/ 3774: /***/ ((module) => { -"use strict"; -module.exports = require("stream/web"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/web"); /***/ }), /***/ 3193: /***/ ((module) => { -"use strict"; -module.exports = require("string_decoder"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); /***/ }), /***/ 4756: /***/ ((module) => { -"use strict"; -module.exports = require("tls"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); /***/ }), /***/ 7016: /***/ ((module) => { -"use strict"; -module.exports = require("url"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); /***/ }), /***/ 9023: /***/ ((module) => { -"use strict"; -module.exports = require("util"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); /***/ }), /***/ 8253: /***/ ((module) => { -"use strict"; -module.exports = require("util/types"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util/types"); /***/ }), /***/ 8167: /***/ ((module) => { -"use strict"; -module.exports = require("worker_threads"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("worker_threads"); /***/ }), /***/ 3106: /***/ ((module) => { -"use strict"; -module.exports = require("zlib"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); /***/ }), /***/ 3932: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const WritableStream = (__nccwpck_require__(7075).Writable) @@ -29897,7 +29508,6 @@ module.exports = Dicer /***/ 6001: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const EventEmitter = (__nccwpck_require__(8474).EventEmitter) @@ -30005,7 +29615,6 @@ module.exports = HeaderParser /***/ 8122: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const inherits = (__nccwpck_require__(7975).inherits) @@ -30026,7 +29635,6 @@ module.exports = PartStream /***/ 4362: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /** @@ -30262,7 +29870,6 @@ module.exports = SBMH /***/ 8819: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const WritableStream = (__nccwpck_require__(7075).Writable) @@ -30355,7 +29962,6 @@ module.exports.Dicer = Dicer /***/ 7962: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // TODO: @@ -30669,7 +30275,6 @@ module.exports = Multipart /***/ 2913: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Decoder = __nccwpck_require__(674) @@ -30867,7 +30472,6 @@ module.exports = UrlEncoded /***/ 674: /***/ ((module) => { -"use strict"; const RE_PLUS = /\+/g @@ -30929,7 +30533,6 @@ module.exports = Decoder /***/ 9434: /***/ ((module) => { -"use strict"; module.exports = function basename (path) { @@ -30951,7 +30554,6 @@ module.exports = function basename (path) { /***/ 1269: /***/ (function(module) { -"use strict"; // Node has always utf-8 @@ -31073,7 +30675,6 @@ module.exports = decodeText /***/ 3215: /***/ ((module) => { -"use strict"; module.exports = function getLimit (limits, name, defaultLimit) { @@ -31097,7 +30698,6 @@ module.exports = function getLimit (limits, name, defaultLimit) { /***/ 2271: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* eslint-disable object-property-newline */ @@ -31296,280 +30896,53 @@ function parseParams (str) { module.exports = parseParams -/***/ }), - -/***/ 5949: -/***/ ((module) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +/***/ }) -// src/index.ts -var src_exports = {}; -__export(src_exports, { - BASE64_REGEX: () => BASE64_REGEX, - BIC_REGEX: () => BIC_REGEX, - CUID2_REGEX: () => CUID2_REGEX, - DECIMAL_REGEX: () => DECIMAL_REGEX, - DIGITS_REGEX: () => DIGITS_REGEX, - EMAIL_REGEX: () => EMAIL_REGEX, - EMOJI_REGEX: () => EMOJI_REGEX, - HEXADECIMAL_REGEX: () => HEXADECIMAL_REGEX, - HEX_COLOR_REGEX: () => HEX_COLOR_REGEX, - IMEI_REGEX: () => IMEI_REGEX, - IPV4_REGEX: () => IPV4_REGEX, - IPV6_REGEX: () => IPV6_REGEX, - IP_REGEX: () => IP_REGEX, - ISO_DATE_REGEX: () => ISO_DATE_REGEX, - ISO_DATE_TIME_REGEX: () => ISO_DATE_TIME_REGEX, - ISO_TIMESTAMP_REGEX: () => ISO_TIMESTAMP_REGEX, - ISO_TIME_REGEX: () => ISO_TIME_REGEX, - ISO_TIME_SECOND_REGEX: () => ISO_TIME_SECOND_REGEX, - ISO_WEEK_REGEX: () => ISO_WEEK_REGEX, - MAC48_REGEX: () => MAC48_REGEX, - MAC64_REGEX: () => MAC64_REGEX, - MAC_REGEX: () => MAC_REGEX, - NANO_ID_REGEX: () => NANO_ID_REGEX, - OCTAL_REGEX: () => OCTAL_REGEX, - ULID_REGEX: () => ULID_REGEX, - UUID_REGEX: () => UUID_REGEX, - ValiError: () => ValiError, - _addIssue: () => _addIssue, - _isLuhnAlgo: () => _isLuhnAlgo, - _isValidObjectKey: () => _isValidObjectKey, - _joinExpects: () => _joinExpects, - _stringify: () => _stringify, - any: () => any, - array: () => array, - arrayAsync: () => arrayAsync, - awaitAsync: () => awaitAsync, - base64: () => base64, - bic: () => bic, - bigint: () => bigint, - blob: () => blob, - boolean: () => boolean, - brand: () => brand, - bytes: () => bytes, - check: () => check, - checkAsync: () => checkAsync, - checkItems: () => checkItems, - config: () => config, - creditCard: () => creditCard, - cuid2: () => cuid2, - custom: () => custom, - customAsync: () => customAsync, - date: () => date, - decimal: () => decimal, - deleteGlobalConfig: () => deleteGlobalConfig, - deleteGlobalMessage: () => deleteGlobalMessage, - deleteSchemaMessage: () => deleteSchemaMessage, - deleteSpecificMessage: () => deleteSpecificMessage, - description: () => description, - digits: () => digits, - email: () => email, - emoji: () => emoji, - empty: () => empty, - endsWith: () => endsWith, - entriesFromList: () => entriesFromList, - enum: () => enum_, - enum_: () => enum_, - everyItem: () => everyItem, - excludes: () => excludes, - fallback: () => fallback, - fallbackAsync: () => fallbackAsync, - file: () => file, - filterItems: () => filterItems, - findItem: () => findItem, - finite: () => finite, - flatten: () => flatten, - forward: () => forward, - forwardAsync: () => forwardAsync, - function: () => function_, - function_: () => function_, - getDefault: () => getDefault, - getDefaults: () => getDefaults, - getDefaultsAsync: () => getDefaultsAsync, - getDotPath: () => getDotPath, - getFallback: () => getFallback, - getFallbacks: () => getFallbacks, - getFallbacksAsync: () => getFallbacksAsync, - getGlobalConfig: () => getGlobalConfig, - getGlobalMessage: () => getGlobalMessage, - getSchemaMessage: () => getSchemaMessage, - getSpecificMessage: () => getSpecificMessage, - hash: () => hash, - hexColor: () => hexColor, - hexadecimal: () => hexadecimal, - imei: () => imei, - includes: () => includes, - instance: () => instance, - integer: () => integer, - intersect: () => intersect, - intersectAsync: () => intersectAsync, - ip: () => ip, - ipv4: () => ipv4, - ipv6: () => ipv6, - is: () => is, - isOfKind: () => isOfKind, - isOfType: () => isOfType, - isValiError: () => isValiError, - isoDate: () => isoDate, - isoDateTime: () => isoDateTime, - isoTime: () => isoTime, - isoTimeSecond: () => isoTimeSecond, - isoTimestamp: () => isoTimestamp, - isoWeek: () => isoWeek, - keyof: () => keyof, - lazy: () => lazy, - lazyAsync: () => lazyAsync, - length: () => length, - literal: () => literal, - looseObject: () => looseObject, - looseObjectAsync: () => looseObjectAsync, - looseTuple: () => looseTuple, - looseTupleAsync: () => looseTupleAsync, - mac: () => mac, - mac48: () => mac48, - mac64: () => mac64, - map: () => map, - mapAsync: () => mapAsync, - mapItems: () => mapItems, - maxBytes: () => maxBytes, - maxLength: () => maxLength, - maxSize: () => maxSize, - maxValue: () => maxValue, - metadata: () => metadata, - mimeType: () => mimeType, - minBytes: () => minBytes, - minLength: () => minLength, - minSize: () => minSize, - minValue: () => minValue, - multipleOf: () => multipleOf, - nan: () => nan, - nanoid: () => nanoid, - never: () => never, - nonEmpty: () => nonEmpty, - nonNullable: () => nonNullable, - nonNullableAsync: () => nonNullableAsync, - nonNullish: () => nonNullish, - nonNullishAsync: () => nonNullishAsync, - nonOptional: () => nonOptional, - nonOptionalAsync: () => nonOptionalAsync, - normalize: () => normalize, - notBytes: () => notBytes, - notLength: () => notLength, - notSize: () => notSize, - notValue: () => notValue, - null: () => null_, - null_: () => null_, - nullable: () => nullable, - nullableAsync: () => nullableAsync, - nullish: () => nullish, - nullishAsync: () => nullishAsync, - number: () => number, - object: () => object, - objectAsync: () => objectAsync, - objectWithRest: () => objectWithRest, - objectWithRestAsync: () => objectWithRestAsync, - octal: () => octal, - omit: () => omit, - optional: () => optional, - optionalAsync: () => optionalAsync, - parse: () => parse, - parseAsync: () => parseAsync, - parser: () => parser, - parserAsync: () => parserAsync, - partial: () => partial, - partialAsync: () => partialAsync, - partialCheck: () => partialCheck, - partialCheckAsync: () => partialCheckAsync, - pick: () => pick, - picklist: () => picklist, - pipe: () => pipe, - pipeAsync: () => pipeAsync, - promise: () => promise, - rawCheck: () => rawCheck, - rawCheckAsync: () => rawCheckAsync, - rawTransform: () => rawTransform, - rawTransformAsync: () => rawTransformAsync, - readonly: () => readonly, - record: () => record, - recordAsync: () => recordAsync, - reduceItems: () => reduceItems, - regex: () => regex, - required: () => required, - requiredAsync: () => requiredAsync, - safeInteger: () => safeInteger, - safeParse: () => safeParse, - safeParseAsync: () => safeParseAsync, - safeParser: () => safeParser, - safeParserAsync: () => safeParserAsync, - set: () => set, - setAsync: () => setAsync, - setGlobalConfig: () => setGlobalConfig, - setGlobalMessage: () => setGlobalMessage, - setSchemaMessage: () => setSchemaMessage, - setSpecificMessage: () => setSpecificMessage, - size: () => size, - someItem: () => someItem, - sortItems: () => sortItems, - startsWith: () => startsWith, - strictObject: () => strictObject, - strictObjectAsync: () => strictObjectAsync, - strictTuple: () => strictTuple, - strictTupleAsync: () => strictTupleAsync, - string: () => string, - symbol: () => symbol, - title: () => title, - toLowerCase: () => toLowerCase, - toMaxValue: () => toMaxValue, - toMinValue: () => toMinValue, - toUpperCase: () => toUpperCase, - transform: () => transform, - transformAsync: () => transformAsync, - trim: () => trim, - trimEnd: () => trimEnd, - trimStart: () => trimStart, - tuple: () => tuple, - tupleAsync: () => tupleAsync, - tupleWithRest: () => tupleWithRest, - tupleWithRestAsync: () => tupleWithRestAsync, - ulid: () => ulid, - undefined: () => undefined_, - undefined_: () => undefined_, - undefinedable: () => undefinedable, - undefinedableAsync: () => undefinedableAsync, - union: () => union, - unionAsync: () => unionAsync, - unknown: () => unknown, - unwrap: () => unwrap, - url: () => url, - uuid: () => uuid, - value: () => value, - variant: () => variant, - variantAsync: () => variantAsync, - void: () => void_, - void_: () => void_ -}); -module.exports = __toCommonJS(src_exports); +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/core.js +var core = __nccwpck_require__(7627); +// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+github@6.0.0/node_modules/@actions/github/lib/github.js +var github = __nccwpck_require__(3802); +;// CONCATENATED MODULE: ./node_modules/.pnpm/valibot@0.42.1_typescript@5.6.2/node_modules/valibot/dist/index.js // src/actions/await/awaitAsync.ts function awaitAsync() { return { @@ -31970,7 +31343,7 @@ function checkItems(requirement, message) { // src/actions/creditCard/creditCard.ts var CREDIT_CARD_REGEX = /^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u; var SANITIZE_REGEX = /[- ]/gu; -var PROVIDER_REGEX_LIST = [ +var PROVIDER_REGEX_LIST = (/* unused pure expression or super */ null && ([ // American Express /^3[47]\d{13}$/u, // Diners Club @@ -31985,7 +31358,7 @@ var PROVIDER_REGEX_LIST = [ /^(?:6[27]\d{14,17}|81\d{14,17})$/u, // Visa /^4\d{12}(?:\d{3,6})?$/u -]; +])); function creditCard(message) { return { kind: "validation", @@ -32554,11 +31927,11 @@ function isoWeek(message) { } // src/actions/length/length.ts -function length(requirement, message) { +function dist_length(requirement, message) { return { kind: "validation", type: "length", - reference: length, + reference: dist_length, async: false, expects: `${requirement}`, requirement, @@ -33958,11 +33331,11 @@ function blob(message) { } // src/schemas/boolean/boolean.ts -function boolean(message) { +function dist_boolean(message) { return { kind: "schema", type: "boolean", - reference: boolean, + reference: dist_boolean, expects: "boolean", async: false, message, @@ -37187,65 +36560,165 @@ function safeParserAsync(schema, config2) { function unwrap(schema) { return schema.wrapped; } -// Annotate the CommonJS export names for ESM import in node: -0 && (0); -/***/ }) +;// CONCATENATED MODULE: ./src/parser.ts -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nccwpck_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ var threw = true; -/******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); -/******/ threw = false; -/******/ } finally { -/******/ if(threw) delete __webpack_module_cache__[moduleId]; -/******/ } -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat */ -/******/ -/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -var exports = __webpack_exports__; +const StringSchema = string(); +const OptionalStringSchema = optional(string()); +const NullableStringSchema = nullable(string()); +const stringParser = parser(StringSchema); +const optionalStringParser = parser(OptionalStringSchema); +const nullableStringParser = parser(NullableStringSchema); -Object.defineProperty(exports, "__esModule", ({ value: true })); +;// CONCATENATED MODULE: ./src/internal/utils.ts +const convertRef = (str, { refType }) => { + if (str === null || str === undefined) + return null; + if (str.startsWith('refs/')) + return str; + switch (refType) { + case 'branch': + return `refs/heads/${str}`; + case 'tag': + return `refs/tags/${str}`; + case 'pull': + return `refs/pull/${str}/merge`; + } +}; + +;// CONCATENATED MODULE: ./src/ref.ts + + +const getRef = ({ eventName, payload }) => { + switch (eventName) { + case 'check_run': + return convertRef(nullableStringParser(payload.check_run.check_suite.head_branch), { refType: 'branch' }); + case 'check_suite': + return convertRef(nullableStringParser(payload.check_suite.head_branch), { + refType: 'branch' + }); + case 'create': + case 'delete': + return convertRef(nullableStringParser(payload.ref), { + refType: payload.ref_type + }); + case 'deployment_status': + return convertRef(optionalStringParser(payload.workflow_run?.head_branch), { + refType: 'branch' + }); + case 'issue_comment': + return convertRef(stringParser(payload.issue?.number.toString()), { + refType: 'pull' + }); + case 'merge_group': + return stringParser(payload.merge_group.head_ref); + case 'pull_request': + case 'pull_request_review': + case 'pull_request_review_comment': + case 'pull_request_target': + return convertRef(payload.pull_request?.number.toString(), { + refType: 'pull' + }); + case 'push': + return stringParser(payload.ref); + case 'registry_package': + return convertRef(optionalStringParser(payload.registry_package?.package_version?.release?.tag_name), { + refType: 'tag' + }); + case 'release': + return convertRef(stringParser(payload.release.tag_name), { + refType: 'tag' + }); + case 'workflow_dispatch': + return stringParser(payload.ref); + case 'workflow_run': + return convertRef(nullableStringParser(payload.workflow_run.head_branch), { + refType: 'branch' + }); + default: + throw new Error(`${eventName} event is not supported.`); + } +}; + +;// CONCATENATED MODULE: ./src/get-inputs.ts + +const getInputs = () => ({ + token: core.getInput('repo-token', { required: true }), + branchNames: core.getInput('branch-names') + .split(/\s+/) + .filter(x => x !== ''), + dryRun: core.getBooleanInput('dry-run') +}); + +;// CONCATENATED MODULE: ./src/main.ts + + + + + +const ansi = { reset: '\x1B[0m', dryRun: '\x1B[38;2;90;185;255m' }; +const prefix = ({ isDryRun = false }) => isDryRun ? `${ansi.dryRun}DRY-RUN MODE ${ansi.reset}` : ''; +const deleteRefActionsCaches = async (octokit, repo, ref, isDryRun) => { + const deleteCache = async (cache) => { + if (!cache.id) + return; + core.info(`${prefix({ isDryRun })} - Cache with key ${cache.key}`); + if (!isDryRun) { + await octokit.rest.actions.deleteActionsCacheById({ + ...repo, + cache_id: cache.id + }); + } + }; + // https://github.com/octokit/plugin-paginate-rest.js#octokitpaginate + const caches = await octokit.paginate(octokit.rest.actions.getActionsCacheList, { + ...repo, + ref, + per_page: 100 + }); + core.startGroup(`${prefix({ isDryRun })}⌛ Deleting ${caches.length} cache(s) on ${ref}`); + await Promise.all(caches.map(async (cache) => deleteCache(cache))); + core.endGroup(); +}; +/** + * The main function for the action. + * @returns {Promise} Resolves when the action is complete. + */ +async function run() { + try { + const { token, branchNames, dryRun: isDryRun } = getInputs(); + const octokit = github.getOctokit(token); + // get repostiory information + const { repo, eventName, payload } = github.context; + const infoNull = (name) => { + core.info(`🤔 Could not determine deletion target: ${name}`); + core.info('ℹī¸ If you suspect this is a bug, please consider raising an issue to help us address it promptly.'); + return []; + }; + const refs = branchNames.length === 0 + ? [getRef({ eventName, payload })].flatMap(x => x ? x : infoNull(eventName)) + : branchNames + .map(branchName => convertRef(branchName, { refType: 'branch' })) + .filter(ref => ref !== null); + for (const ref of refs) { + await deleteRefActionsCaches(octokit, repo, ref, isDryRun); + } + core.info(`${prefix({ isDryRun })}✅ Done`); + } + catch (error) { + // Fail the workflow run if an error occurs + if (error instanceof Error) { + core.setFailed(error.message); + core.info('ℹī¸ If you suspect this is a bug, please consider raising an issue to help us address it promptly.'); + } + } +} + +;// CONCATENATED MODULE: ./src/index.ts /** * The entrypoint for the action. */ -const main_1 = __nccwpck_require__(7855); -(0, main_1.run)(); -})(); +run(); -module.exports = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/dist/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/package.json b/package.json index 5ee1a06..c7d8aaf 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "cache", "delete" ], + "type": "module", "exports": { ".": "./dist/index.js" }, @@ -37,7 +38,7 @@ }, "license": "MIT", "jest": { - "preset": "ts-jest", + "preset": "ts-jest/presets/default-esm", "verbose": true, "clearMocks": true, "testEnvironment": "node", @@ -52,8 +53,8 @@ "/node_modules/", "/dist/" ], - "transform": { - "^.+\\.ts$": "ts-jest" + "moduleNameMapper": { + "^(\\.{1,2}/.*)\\.js$": "$1" }, "coverageReporters": [ "json-summary", diff --git a/src/index.ts b/src/index.ts index 887602a..76ce87a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ /** * The entrypoint for the action. */ -import { run } from './main' +import { run } from './main.js' run() diff --git a/src/main.ts b/src/main.ts index 2a4622d..bab0b24 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,9 @@ import * as core from '@actions/core' import * as github from '@actions/github' -import { getRef } from './ref' +import { getRef } from './ref.js' import type * as types from '@octokit/openapi-types' -import { getInputs } from './get-inputs' -import { convertRef } from './internal/utils' +import { getInputs } from './get-inputs.js' +import { convertRef } from './internal/utils.js' type Cache = types.components['schemas']['actions-cache-list']['actions_caches'][number] diff --git a/src/ref.ts b/src/ref.ts index 259110c..3282df8 100644 --- a/src/ref.ts +++ b/src/ref.ts @@ -1,10 +1,10 @@ -import { WebhookPayload } from '@actions/github/lib/interfaces' +import { WebhookPayload } from '@actions/github/lib/interfaces.js' import { optionalStringParser, nullableStringParser, stringParser -} from './parser' -import { convertRef } from './internal/utils' +} from './parser.js' +import { convertRef } from './internal/utils.js' export const getRef = ({ eventName,