Skip to content

Commit f9a70b4

Browse files
committed
Install doppler cli from gh releases
1 parent 014df23 commit f9a70b4

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

index.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
const core = require('@actions/core');
2-
const tc = require('@actions/tool-cache');
3-
const io = require('@actions/io');
4-
const { execSync } = require('child_process');
1+
const core = require("@actions/core");
2+
const tc = require("@actions/tool-cache");
3+
const io = require("@actions/io");
4+
const { execSync } = require("child_process");
55

66
const workspace = process.env.GITHUB_WORKSPACE;
77
const binDir = `${workspace}/bin`;
88

9-
run().catch(error => {
9+
run().catch((error) => {
1010
core.setFailed(error.message);
11-
})
11+
});
1212

1313
async function run() {
1414
switch (process.platform) {
1515
case "win32": {
16-
const url = 'https://cli.doppler.com/download?os=windows&arch=amd64&format=zip';
16+
const url =
17+
"https://cli.doppler.com/download?os=windows&arch=amd64&format=zip";
1718
await installZip(binDir, url);
1819
break;
1920
}
2021
case "linux":
2122
case "darwin": {
22-
await executeInstallSh(binDir)
23+
await executeInstallSh(binDir);
2324
break;
2425
}
2526
default: {
@@ -37,15 +38,17 @@ async function installZip(path, url) {
3738

3839
async function executeInstallSh(installPath) {
3940
// download script
40-
const url = "https://cli.doppler.com/install.sh";
41+
const url =
42+
"https://github.com/DopplerHQ/cli/releases/download/3.75.0/doppler_3.75.0_linux_amd64.deb";
4143
const downloadPath = await tc.downloadTool(url);
4244
execSync(`chmod +x ${downloadPath}`);
45+
execSync(`dpkg -i ${downloadPath}`);
4346

4447
// execute script
45-
await io.mkdirP(installPath);
46-
const installCommand = `${downloadPath} --debug --no-package-manager --install-path ${installPath}`
47-
stdout = execSync(installCommand, { timeout: 30000 });
48-
console.log(Buffer.from(stdout).toString("utf-8"))
48+
// await io.mkdirP(installPath);
49+
// const installCommand = `${downloadPath} --debug --no-package-manager --install-path ${installPath}`;
50+
// stdout = execSync(installCommand, { timeout: 30000 });
51+
// console.log(Buffer.from(stdout).toString("utf-8"));
4952

5053
// add binary to PATH
5154
core.addPath(installPath);

0 commit comments

Comments
 (0)