Skip to content

Commit 36b7264

Browse files
author
Enda Phelan
committed
fix: get full path to binary
1 parent cba24f4 commit 36b7264

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dist/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const util = __importStar(__webpack_require__(669));
110110
const github = __importStar(__webpack_require__(928));
111111
const core = __importStar(__webpack_require__(186));
112112
const tc = __importStar(__webpack_require__(784));
113+
const path = __importStar(__webpack_require__(622));
113114
function getGitChglog(version) {
114115
return __awaiter(this, void 0, void 0, function* () {
115116
const release = yield github.getRelease(version);
@@ -127,7 +128,7 @@ function getGitChglog(version) {
127128
extPath = yield tc.extractTar(downloadPath);
128129
const cachePath = yield tc.cacheDir(extPath, 'install-git-chglog', release.tag_name.replace(/^v/, ''));
129130
core.debug(`Cached to ${cachePath}`);
130-
const exePath = 'git-chglog';
131+
const exePath = path.join(cachePath, 'git-chglog');
131132
core.debug(`Exe path is ${exePath}`);
132133
return exePath;
133134
});
@@ -187,8 +188,9 @@ function run() {
187188
return __awaiter(this, void 0, void 0, function* () {
188189
try {
189190
const version = core.getInput('version') || 'latest';
190-
const workdir = core.getInput('workdir') || '.';
191+
const workdir = '.';
191192
const gitChglog = yield installer_1.getGitChglog(version);
193+
core.debug(gitChglog);
192194
core.info(`✅ git-chglog installed successfully`);
193195
const gitChglogDir = path_1.dirname(gitChglog);
194196
core.addPath(gitChglogDir);

src/installer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as util from 'util';
22
import * as github from './github';
33
import * as core from '@actions/core';
44
import * as tc from '@actions/tool-cache';
5+
import * as path from 'path';
56

67
export async function getGitChglog(version: string): Promise<string> {
78
const release: github.GitHubRelease | null = await github.getRelease(version);
@@ -15,6 +16,7 @@ export async function getGitChglog(version: string): Promise<string> {
1516

1617
core.info(`⬇️ Downloading ${downloadUrl}...`);
1718
const downloadPath: string = await tc.downloadTool(downloadUrl);
19+
1820
core.debug(`Downloaded to ${downloadPath}`);
1921

2022
core.info('📦 Extracting git-chglog...');
@@ -24,7 +26,7 @@ export async function getGitChglog(version: string): Promise<string> {
2426
const cachePath: string = await tc.cacheDir(extPath, 'install-git-chglog', release.tag_name.replace(/^v/, ''));
2527
core.debug(`Cached to ${cachePath}`);
2628

27-
const exePath: string = 'git-chglog';
29+
const exePath: string = path.join(cachePath, 'git-chglog');
2830
core.debug(`Exe path is ${exePath}`);
2931

3032
return exePath;

0 commit comments

Comments
 (0)