Skip to content

Commit 421fe6f

Browse files
committed
Repackage action following @actions/http-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 4261dba commit 421fe6f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

dist/index.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -3301,7 +3301,7 @@ class HttpClient {
33013301
if (this._keepAlive && useProxy) {
33023302
agent = this._proxyAgent;
33033303
}
3304-
if (this._keepAlive && !useProxy) {
3304+
if (!useProxy) {
33053305
agent = this._agent;
33063306
}
33073307
// if agent is already assigned use that agent.
@@ -3333,16 +3333,12 @@ class HttpClient {
33333333
agent = tunnelAgent(agentOptions);
33343334
this._proxyAgent = agent;
33353335
}
3336-
// if reusing agent across request and tunneling agent isn't assigned create a new agent
3337-
if (this._keepAlive && !agent) {
3336+
// if tunneling agent isn't assigned create a new agent
3337+
if (!agent) {
33383338
const options = { keepAlive: this._keepAlive, maxSockets };
33393339
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
33403340
this._agent = agent;
33413341
}
3342-
// if not using private agent and tunnel agent isn't setup then use global agent
3343-
if (!agent) {
3344-
agent = usingSsl ? https.globalAgent : http.globalAgent;
3345-
}
33463342
if (usingSsl && this._ignoreSslError) {
33473343
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
33483344
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options

0 commit comments

Comments
 (0)