Skip to content

Commit

Permalink
fix: add uuid for ssh scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
easingthemes committed Sep 24, 2023
1 parent d91ea7e commit 66f6e4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/remoteCmd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { exec } = require('child_process');
const crypto = require('crypto');
const { sshServer, githubWorkspace, remotePort } = require('./inputs');
const { writeToFile } = require('./helpers');

Expand All @@ -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;
Expand Down

0 comments on commit 66f6e4b

Please sign in to comment.