fix: add uuid for ssh scripts

This commit is contained in:
Dragan Filipovic 2023-09-24 17:29:49 +02:00
parent d91ea7e0f7
commit 66f6e4b367

View File

@ -1,4 +1,5 @@
const { exec } = require('child_process'); const { exec } = require('child_process');
const crypto = require('crypto');
const { sshServer, githubWorkspace, remotePort } = require('./inputs'); const { sshServer, githubWorkspace, remotePort } = require('./inputs');
const { writeToFile } = require('./helpers'); const { writeToFile } = require('./helpers');
@ -12,7 +13,8 @@ const handleError = (message, isRequired, callback) => {
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Promise((resolve, reject) => { const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Promise((resolve, reject) => {
const filename = `local_ssh_script-${label}.sh`; const uuid = crypto.randomUUID();
const filename = `local_ssh_script-${label}-${uuid}.sh`;
try { try {
writeToFile({ dir: githubWorkspace, filename, content }); writeToFile({ dir: githubWorkspace, filename, content });
const dataLimit = 10000; const dataLimit = 10000;