Skip to content

Commit e39b258

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 28c747f commit e39b258

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

dist/index.js

+18-8
Original file line numberDiff line numberDiff line change
@@ -11783,7 +11783,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1178311783
});
1178411784
};
1178511785
Object.defineProperty(exports, "__esModule", ({ value: true }));
11786-
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpCodes = void 0;
11786+
exports.HttpClient = exports.HttpClientResponse = exports.HttpCodes = void 0;
11787+
exports.isHttps = isHttps;
1178711788
const url = __nccwpck_require__(7310);
1178811789
const http = __nccwpck_require__(3685);
1178911790
const https = __nccwpck_require__(5687);
@@ -11863,7 +11864,6 @@ function isHttps(requestUrl) {
1186311864
let parsedUrl = url.parse(requestUrl);
1186411865
return parsedUrl.protocol === 'https:';
1186511866
}
11866-
exports.isHttps = isHttps;
1186711867
var EnvironmentVariables;
1186811868
(function (EnvironmentVariables) {
1186911869
EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
@@ -11880,6 +11880,10 @@ class HttpClient {
1188011880
this._maxRetries = 1;
1188111881
this._keepAlive = false;
1188211882
this._disposed = false;
11883+
this._httpGlobalAgentOptions = {
11884+
keepAlive: false,
11885+
timeout: 30000
11886+
};
1188311887
this.userAgent = userAgent;
1188411888
this.handlers = handlers || [];
1188511889
let no_proxy = process.env[EnvironmentVariables.NO_PROXY];
@@ -11902,6 +11906,9 @@ class HttpClient {
1190211906
this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
1190311907
});
1190411908
}
11909+
if (requestOptions.globalAgentOptions) {
11910+
this._httpGlobalAgentOptions = requestOptions.globalAgentOptions;
11911+
}
1190511912
this._certConfig = requestOptions.cert;
1190611913
if (this._certConfig) {
1190711914
// If using cert, need fs
@@ -12212,7 +12219,11 @@ class HttpClient {
1221212219
}
1221312220
// if not using private agent and tunnel agent isn't setup then use global agent
1221412221
if (!agent) {
12215-
agent = usingSsl ? https.globalAgent : http.globalAgent;
12222+
const globalAgentOptions = {
12223+
keepAlive: this._httpGlobalAgentOptions.keepAlive,
12224+
timeout: this._httpGlobalAgentOptions.timeout
12225+
};
12226+
agent = usingSsl ? new https.Agent(globalAgentOptions) : new http.Agent(globalAgentOptions);
1221612227
}
1221712228
if (usingSsl && this._ignoreSslError) {
1221812229
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
@@ -12525,7 +12536,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1252512536
});
1252612537
};
1252712538
Object.defineProperty(exports, "__esModule", ({ value: true }));
12528-
exports.obtainContentCharset = exports.buildProxyBypassRegexFromEnv = exports.decompressGzippedContent = exports.getUrl = void 0;
12539+
exports.getUrl = getUrl;
12540+
exports.decompressGzippedContent = decompressGzippedContent;
12541+
exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv;
12542+
exports.obtainContentCharset = obtainContentCharset;
1252912543
const qs = __nccwpck_require__(2760);
1253012544
const url = __nccwpck_require__(7310);
1253112545
const path = __nccwpck_require__(1017);
@@ -12563,7 +12577,6 @@ function getUrl(resource, baseUrl, queryParams) {
1256312577
getUrlWithParsedQueryParams(requestUrl, queryParams) :
1256412578
requestUrl;
1256512579
}
12566-
exports.getUrl = getUrl;
1256712580
/**
1256812581
*
1256912582
* @param {string} requestUrl
@@ -12613,7 +12626,6 @@ function decompressGzippedContent(buffer, charset) {
1261312626
}));
1261412627
});
1261512628
}
12616-
exports.decompressGzippedContent = decompressGzippedContent;
1261712629
/**
1261812630
* Builds a RegExp to test urls against for deciding
1261912631
* wether to bypass proxy from an entry of the
@@ -12635,7 +12647,6 @@ function buildProxyBypassRegexFromEnv(bypass) {
1263512647
throw err;
1263612648
}
1263712649
}
12638-
exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv;
1263912650
/**
1264012651
* Obtain Response's Content Charset.
1264112652
* Through inspecting `content-type` response header.
@@ -12659,7 +12670,6 @@ function obtainContentCharset(response) {
1265912670
}
1266012671
return 'utf-8';
1266112672
}
12662-
exports.obtainContentCharset = obtainContentCharset;
1266312673

1266412674

1266512675
/***/ }),

0 commit comments

Comments
 (0)