Skip to content

Commit 9bb3541

Browse files
author
John Kjell
committed
Don't write to file without a parameter set
Signed-off-by: John Kjell <[email protected]>
1 parent 3f3cb2a commit 9bb3541

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

dist/index.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,7 @@ class HttpClient {
23252325
if (this._keepAlive && useProxy) {
23262326
agent = this._proxyAgent;
23272327
}
2328-
if (this._keepAlive && !useProxy) {
2328+
if (!useProxy) {
23292329
agent = this._agent;
23302330
}
23312331
// if agent is already assigned use that agent.
@@ -2357,16 +2357,12 @@ class HttpClient {
23572357
agent = tunnelAgent(agentOptions);
23582358
this._proxyAgent = agent;
23592359
}
2360-
// if reusing agent across request and tunneling agent isn't assigned create a new agent
2361-
if (this._keepAlive && !agent) {
2360+
// if tunneling agent isn't assigned create a new agent
2361+
if (!agent) {
23622362
const options = { keepAlive: this._keepAlive, maxSockets };
23632363
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
23642364
this._agent = agent;
23652365
}
2366-
// if not using private agent and tunnel agent isn't setup then use global agent
2367-
if (!agent) {
2368-
agent = usingSsl ? https.globalAgent : http.globalAgent;
2369-
}
23702366
if (usingSsl && this._ignoreSslError) {
23712367
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
23722368
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
@@ -30527,9 +30523,6 @@ async function run() {
3052730523
const intermediates = core.getInput("intermediates").split(" ");
3052830524
const key = core.getInput("key");
3052930525
let outfile = core.getInput("outfile");
30530-
outfile = outfile
30531-
? outfile
30532-
: path.join(os.tmpdir(), step + "-attestation.json");
3053330526
const productExcludeGlob = core.getInput("product-exclude-glob");
3053430527
const productIncludeGlob = core.getInput("product-include-glob");
3053530528
const spiffeSocket = core.getInput("spiffe-socket");
@@ -30595,7 +30588,8 @@ async function run() {
3059530588
}
3059630589

3059730590
if (trace) cmd.push(`--trace=${trace}`);
30598-
cmd.push(`--outfile=${outfile}`);
30591+
if (outfile)
30592+
cmd.push(`--outfile=${outfile}`);
3059930593
core.info("Running in directory " + process.env.GITHUB_WORKSPACE);
3060030594

3060130595
process.env.PATH = `${__dirname}:${process.env.PATH}`;

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ async function run() {
5050
const intermediates = core.getInput("intermediates").split(" ");
5151
const key = core.getInput("key");
5252
let outfile = core.getInput("outfile");
53-
outfile = outfile
54-
? outfile
55-
: path.join(os.tmpdir(), step + "-attestation.json");
5653
const productExcludeGlob = core.getInput("product-exclude-glob");
5754
const productIncludeGlob = core.getInput("product-include-glob");
5855
const spiffeSocket = core.getInput("spiffe-socket");
@@ -118,7 +115,8 @@ async function run() {
118115
}
119116

120117
if (trace) cmd.push(`--trace=${trace}`);
121-
cmd.push(`--outfile=${outfile}`);
118+
if (outfile)
119+
cmd.push(`--outfile=${outfile}`);
122120
core.info("Running in directory " + process.env.GITHUB_WORKSPACE);
123121

124122
process.env.PATH = `${__dirname}:${process.env.PATH}`;

0 commit comments

Comments
 (0)