From d5ea8f675000e70e4dfd9706418ffd0a385a653d Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 5 Nov 2022 17:51:23 +0100 Subject: [PATCH] gha: Get correct file name before renaming --- .github/workflows/Nuget-publishing.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Nuget-publishing.yml b/.github/workflows/Nuget-publishing.yml index 53e25218..9aaff37e 100644 --- a/.github/workflows/Nuget-publishing.yml +++ b/.github/workflows/Nuget-publishing.yml @@ -45,6 +45,7 @@ jobs: let sourceFile = ""; let destDir = ""; let destFile = ""; + var output = {}; for (const artifact of allArtifacts.data.artifacts) { switch(artifact.name) { case 'ubuntu-cmake-aarch64.7z': @@ -109,7 +110,9 @@ jobs: console.log(`Extracting library from 7z file to: ${destDir}/${sourceFile}`); await exec.exec("7z", ["e", `-o${destDir}/`, `/home/runner/${artifact.name}`, `${sourceDir}${sourceFile}`], options); if (sourceFile != destFile) { - console.log(`Renaming library to: ${destFile}`); + output = await exec.getExecOutput("ls", [destDir], options); + sourceFile = output.stdout.trim(); + console.log(`Renaming ${sourceFile} to ${destFile}`); await exec.exec("mv", [`${destDir}/${sourceFile}`, `${destDir}/${destFile}`], options); } }