Skip to content

Commit

Permalink
Update git action
Browse files Browse the repository at this point in the history
Signed-off-by: fsadfsdf <[email protected]>
  • Loading branch information
sverdlov93 committed Sep 19, 2023
1 parent de2af45 commit 0220f80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion action/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ class Utils {
return __awaiter(this, void 0, void 0, function* () {
let cliDir = yield (0, tool_cache_1.cacheFile)(downloadDir, fileName, Utils.TOOL_NAME, version);
if (!Utils.isWindows()) {
(0, fs_1.chmodSync)((0, path_1.join)(cliDir, fileName), 0o555);
let filePath = (0, path_1.normalize)((0, path_1.join)(cliDir, fileName));
(0, fs_1.chmodSync)(filePath, 0o555);
}
core.addPath(cliDir);
});
Expand Down
9 changes: 5 additions & 4 deletions action/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { context as githubContext } from '@actions/github';
import { downloadTool, find, cacheFile } from '@actions/tool-cache';
import { chmodSync } from 'fs';
import { platform, arch } from 'os';
import { join } from 'path';
import {BranchSummary, SimpleGit, simpleGit} from 'simple-git';
import { normalize, join } from 'path';
import { BranchSummary, SimpleGit, simpleGit } from 'simple-git';

export class Utils {
private static readonly LATEST_RELEASE_VERSION: string = '[RELEASE]';
Expand Down Expand Up @@ -68,7 +68,7 @@ export class Utils {
*/
public static async execScanPullRequest() {
if (!process.env.JF_GIT_BASE_BRANCH) {
core.exportVariable('JF_GIT_BASE_BRANCH', githubContext.ref)
core.exportVariable('JF_GIT_BASE_BRANCH', githubContext.ref);
}
let res: number = await exec(Utils.getExecutableName(), ['scan-pull-request']);
if (res !== core.ExitCode.Success) {
Expand Down Expand Up @@ -121,7 +121,8 @@ export class Utils {
private static async cacheAndAddPath(downloadDir: string, version: string, fileName: string) {
let cliDir: string = await cacheFile(downloadDir, fileName, Utils.TOOL_NAME, version);
if (!Utils.isWindows()) {
chmodSync(join(cliDir, fileName), 0o555);
let filePath: string = normalize(join(cliDir, fileName));
chmodSync(filePath, 0o555);
}
core.addPath(cliDir);
}
Expand Down

0 comments on commit 0220f80

Please sign in to comment.