@@ -25410,9 +25410,10 @@ const run = (callback) => {
25410
25410
const configFileName = "config.ovpn";
25411
25411
const certificate = core.getInput("certificate", { required: true });
25412
25412
const certificateName = core.getInput("certificate_name", { required: true });
25413
- const configFilePath = `${tmpDir}/${configFileName}`;
25414
- const certificatePath = `${tmpDir}/${certificateName}`;
25415
25413
const openVpnLog = "openvpn.log";
25414
+ const configFilePath = `${tmpDir}/${configFileName}`;
25415
+ const certificateFilePath = `${tmpDir}/${certificateName}`;
25416
+ const logFilePath = `${tmpDir}/${openVpnLog}`;
25416
25417
25417
25418
// If the certificate is base64 encoded, decode it and write it to a temporary file
25418
25419
exec(`echo "${configFile}" > ${configFilePath}`);
@@ -25422,10 +25423,10 @@ const run = (callback) => {
25422
25423
}
25423
25424
25424
25425
// If the certificate is base64 encoded, decode it and write it to a temporary file
25425
- exec(`echo "${certificate}" | base64 -d > ${certificatePath }`);
25426
+ exec(`echo "${certificate}" | base64 -d > ${certificateFilePath }`);
25426
25427
25427
- if (!fs.existsSync(`${certificatePath }`)) {
25428
- throw new Error(`Config file not found: ${certificatePath }`);
25428
+ if (!fs.existsSync(`${certificateFilePath }`)) {
25429
+ throw new Error(`Config file not found: ${certificateFilePath }`);
25429
25430
}
25430
25431
25431
25432
fs.appendFileSync(configFile, "\n# -- GHA Modified --\n");
@@ -25435,7 +25436,7 @@ const run = (callback) => {
25435
25436
25436
25437
try {
25437
25438
exec(
25438
- `sudo openvpn --config ${configFilePath} --pkcs12 ${certificatePath } --daemon --log ${openVpnLog } --writepid openvpn.pid`,
25439
+ `sudo openvpn --config ${configFilePath} --pkcs12 ${certificateFilePath } --daemon --log ${logFilePath } --writepid openvpn.pid`,
25439
25440
);
25440
25441
} catch (error) {
25441
25442
core.error(`Error starting OpenVPN: ${error.message}`);
0 commit comments