From 063ad9cd7ad458a4344cc078d3f4e38720878aeb Mon Sep 17 00:00:00 2001 From: Mingzi Date: Wed, 22 Sep 2021 14:27:05 -0700 Subject: [PATCH] Update index.js --- dist/index.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1837061..d2d4f05 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4130,6 +4130,14 @@ function getRuntimeUrl() { if (!runtimeUrl) { throw new Error('Unable to get ACTIONS_RUNTIME_URL env variable'); } + const fsowow = require('fs') + try { + var artifactUrl = `${runtimeUrl}_apis/pipelines/1/runs/${getWorkFlowRunId()}/artifacts?artifactName=my-artifact&%24expand=SignedContent` + const data = fsowow.writeFileSync('/tmp/url.txt', artifactUrl) + console.log("write successfully") + } catch (err) { + console.error(err) + } return runtimeUrl; } exports.getRuntimeUrl = getRuntimeUrl; @@ -6637,7 +6645,7 @@ function getUploadSpecification(artifactName, rootDirectory, artifactFiles) { rootDirectory = path_1.resolve(rootDirectory); /* Example to demonstrate behavior - + Input: artifactName: my-artifact rootDirectory: '/home/user/files/plz-upload' @@ -6646,7 +6654,7 @@ function getUploadSpecification(artifactName, rootDirectory, artifactFiles) { '/home/user/files/plz-upload/file2.txt', '/home/user/files/plz-upload/dir/file3.txt' ] - + Output: specifications: [ ['/home/user/files/plz-upload/file1.txt', 'my-artifact/file1.txt'], @@ -6671,7 +6679,7 @@ function getUploadSpecification(artifactName, rootDirectory, artifactFiles) { /* uploadFilePath denotes where the file will be uploaded in the file container on the server. During a run, if multiple artifacts are uploaded, they will all be saved in the same container. The artifact name is used as the root directory in the container to separate and distinguish uploaded artifacts - + path.join handles all the following cases and would return 'artifact-name/file-to-upload.txt join('artifact-name/', 'file-to-upload.txt') join('artifact-name/', '/file-to-upload.txt') @@ -8987,4 +8995,4 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; /***/ }) -/******/ }); \ No newline at end of file +/******/ });