From 66f6e4b367ea39479c285234797a4e86c90d9abd Mon Sep 17 00:00:00 2001 From: Dragan Filipovic Date: Sun, 24 Sep 2023 17:29:49 +0200 Subject: [PATCH] fix: add uuid for ssh scripts --- src/remoteCmd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/remoteCmd.js b/src/remoteCmd.js index 328e8aa..3881b20 100644 --- a/src/remoteCmd.js +++ b/src/remoteCmd.js @@ -1,4 +1,5 @@ const { exec } = require('child_process'); +const crypto = require('crypto'); const { sshServer, githubWorkspace, remotePort } = require('./inputs'); const { writeToFile } = require('./helpers'); @@ -12,7 +13,8 @@ const handleError = (message, isRequired, callback) => { // eslint-disable-next-line max-len 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 { writeToFile({ dir: githubWorkspace, filename, content }); const dataLimit = 10000;