mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-26 00:18:30 +02:00
Resolve input path
This commit is contained in:
parent
275f2e06ca
commit
37d541d232
4 changed files with 16 additions and 2 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -6634,12 +6634,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const artifact = __importStar(__webpack_require__(214));
|
||||
const path_1 = __webpack_require__(622);
|
||||
const constants_1 = __webpack_require__(694);
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const name = core.getInput(constants_1.Inputs.Name, { required: false });
|
||||
const path = core.getInput(constants_1.Inputs.Path, { required: false });
|
||||
const testing = path_1.resolve(path);
|
||||
core.info(`Will tilde expansion work... ${testing}`);
|
||||
const artifactClient = artifact.create();
|
||||
if (!name) {
|
||||
// download all artifacts
|
||||
|
@ -6661,7 +6664,7 @@ function run() {
|
|||
core.info(`Artifact ${downloadResponse.artifactName} was downloaded to ${downloadResponse.downloadPath}`);
|
||||
}
|
||||
// output the directory that the artifact(s) was/were downloaded to
|
||||
core.setOutput(constants_1.Outputs.DownloadPath, path);
|
||||
core.setOutput(constants_1.Outputs.DownloadPath, path_1.resolve(path));
|
||||
core.info('Artifact download has finished successfully');
|
||||
}
|
||||
catch (err) {
|
||||
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -184,6 +184,12 @@
|
|||
"integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.0.22",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.22.tgz",
|
||||
"integrity": "sha512-emeGcJvdiZ4Z3ohbmw93E/64jRzUHAItSHt8nF7M4TGgQTiWqFVGB8KNpLGFmUHmHLvjvBgFwVlqNcq+VuGv9g==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/normalize-package-data": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"devDependencies": {
|
||||
"@actions/artifact": "^0.3.1",
|
||||
"@actions/core": "^1.2.4",
|
||||
"@types/node": "^14.0.22",
|
||||
"@typescript-eslint/parser": "^2.30.0",
|
||||
"@zeit/ncc": "^0.22.1",
|
||||
"concurrently": "^5.2.0",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import * as core from '@actions/core'
|
||||
import * as artifact from '@actions/artifact'
|
||||
import {resolve} from 'path'
|
||||
import {Inputs, Outputs} from './constants'
|
||||
|
||||
async function run(): Promise<void> {
|
||||
|
@ -7,6 +8,9 @@ async function run(): Promise<void> {
|
|||
const name = core.getInput(Inputs.Name, {required: false})
|
||||
const path = core.getInput(Inputs.Path, {required: false})
|
||||
|
||||
const testing = resolve(path)
|
||||
core.info(`Will tilde expansion work... ${testing}`)
|
||||
|
||||
const artifactClient = artifact.create()
|
||||
if (!name) {
|
||||
// download all artifacts
|
||||
|
@ -37,7 +41,7 @@ async function run(): Promise<void> {
|
|||
)
|
||||
}
|
||||
// output the directory that the artifact(s) was/were downloaded to
|
||||
core.setOutput(Outputs.DownloadPath, path)
|
||||
core.setOutput(Outputs.DownloadPath, resolve(path))
|
||||
core.info('Artifact download has finished successfully')
|
||||
} catch (err) {
|
||||
core.setFailed(err.message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue