Skip to content

Commit 01c85ef

Browse files
committed
Repackage action following typed-rest-client bump
GitHub downloads each action run in a workflow during runtime and executes it as a complete package of code before you can use workflow commands like run to interact with the runner machine. This means that we must provide all JavaScript package dependencies as part of the distributed action in order for it to be usable in workflows. A naive approach to doing this is checking in the `node_modules` folder. However, this approach results in a huge amount of frequently changing external content being included in the repository, much of which is not even part of the executed program. A far better approach is to use the excellent ncc tool to compile the program, including all the relevant code from the dependencies, into a single file. We use a "continuous packaging" approach, where the packaged action code that is generated via ncc is always kept in sync with the development source code and dependencies. This allows a beta version of the action to be easily used in workflows by beta testers or those who need changes not in the release simply by using the name of the branch as the action ref (e.g., `uses: arduino/arduino-lint-action@main` will cause the version of the action from the tip of the `main` branch to be used by the workflow run). The update of the package dependency results in a change to the packaged code, so the packaging is here updated accordingly.
1 parent 6b2d3e1 commit 01c85ef

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

dist/index.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -11765,14 +11765,16 @@ exports.debug = debug; // for test
1176511765
// Copyright (c) Microsoft. All rights reserved.
1176611766
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1176711767
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11768+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1176811769
return new (P || (P = Promise))(function (resolve, reject) {
1176911770
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1177011771
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11771-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
11772+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1177211773
step((generator = generator.apply(thisArg, _arguments || [])).next());
1177311774
});
1177411775
};
1177511776
Object.defineProperty(exports, "__esModule", ({ value: true }));
11777+
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpCodes = void 0;
1177611778
const url = __nccwpck_require__(7310);
1177711779
const http = __nccwpck_require__(3685);
1177811780
const https = __nccwpck_require__(5687);
@@ -11808,7 +11810,7 @@ var HttpCodes;
1180811810
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
1180911811
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
1181011812
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
11811-
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
11813+
})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
1181211814
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
1181311815
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
1181411816
const NetworkRetryErrors = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED'];
@@ -12275,14 +12277,16 @@ exports.HttpClient = HttpClient;
1227512277
// Copyright (c) Microsoft. All rights reserved.
1227612278
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1227712279
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12280+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1227812281
return new (P || (P = Promise))(function (resolve, reject) {
1227912282
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1228012283
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12281-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
12284+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1228212285
step((generator = generator.apply(thisArg, _arguments || [])).next());
1228312286
});
1228412287
};
1228512288
Object.defineProperty(exports, "__esModule", ({ value: true }));
12289+
exports.RestClient = void 0;
1228612290
const httpm = __nccwpck_require__(5538);
1228712291
const util = __nccwpck_require__(9470);
1228812292
class RestClient {
@@ -12503,14 +12507,16 @@ exports.RestClient = RestClient;
1250312507
// Copyright (c) Microsoft. All rights reserved.
1250412508
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1250512509
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12510+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1250612511
return new (P || (P = Promise))(function (resolve, reject) {
1250712512
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1250812513
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12509-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
12514+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1251012515
step((generator = generator.apply(thisArg, _arguments || [])).next());
1251112516
});
1251212517
};
1251312518
Object.defineProperty(exports, "__esModule", ({ value: true }));
12519+
exports.obtainContentCharset = exports.buildProxyBypassRegexFromEnv = exports.decompressGzippedContent = exports.getUrl = void 0;
1251412520
const qs = __nccwpck_require__(2760);
1251512521
const url = __nccwpck_require__(7310);
1251612522
const path = __nccwpck_require__(1017);
@@ -12639,7 +12645,10 @@ function obtainContentCharset(response) {
1263912645
const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex'];
1264012646
const contentType = response.message.headers['content-type'] || '';
1264112647
const matches = contentType.match(/charset=([^;,\r\n]+)/i);
12642-
return (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) ? matches[1] : 'utf-8';
12648+
if (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) {
12649+
return matches[1];
12650+
}
12651+
return 'utf-8';
1264312652
}
1264412653
exports.obtainContentCharset = obtainContentCharset;
1264512654

0 commit comments

Comments
 (0)