Skip to content

Commit

Permalink
Fix missing cached JFrog CLI path on cleanup task (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 authored Sep 2, 2024
1 parent 17e5928 commit 900773d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ class Utils {
if (jfExecDir && jfrogExecDir) {
core.addPath(jfExecDir);
core.addPath(jfrogExecDir);
// Save the JF CLI path to use on cleanup. saveState/getState are methods to pass data between a step, and it's cleanup function.
core.saveState(Utils.JF_CLI_PATH_STATE, jfExecDir);
return true;
}
return false;
Expand Down
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as core from '@actions/core';
import { exec, ExecOptions, ExecOutput, getExecOutput } from '@actions/exec';
import { HttpClient, HttpClientResponse } from '@actions/http-client';
import * as toolCache from '@actions/tool-cache';
import { chmodSync, existsSync, mkdirSync, promises as fs } from 'fs';
import { chmodSync, existsSync, promises as fs } from 'fs';
import { OutgoingHttpHeaders } from 'http';
import { arch, platform, tmpdir } from 'os';
import * as path from 'path';
Expand Down Expand Up @@ -265,6 +265,8 @@ export class Utils {
if (jfExecDir && jfrogExecDir) {
core.addPath(jfExecDir);
core.addPath(jfrogExecDir);
// Save the JF CLI path to use on cleanup. saveState/getState are methods to pass data between a step, and it's cleanup function.
core.saveState(Utils.JF_CLI_PATH_STATE, jfExecDir);
return true;
}
return false;
Expand Down

0 comments on commit 900773d

Please sign in to comment.