mirror of
https://github.com/actions/upload-artifact.git
synced 2025-04-20 10:11:21 +00:00
Update index.js
This commit is contained in:
parent
11e311c8b5
commit
063ad9cd7a
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -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;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/******/ });
|
||||
|
Loading…
Reference in New Issue
Block a user