From 539315322aa76bc3e99114736508facb4e464b89 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Mon, 13 Jul 2020 14:39:01 +0200 Subject: [PATCH] README updates --- README.md | 21 +++++++++++++++++++-- dist/index.js | 4 +--- src/constants.ts | 2 +- src/download-artifact.ts | 3 --- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5b85788..3771474 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,7 @@ To maintain the same behavior for `v2`, you can set the `path` to the name of th # Download All Artifacts -If the `name` input parameter is not provided, all artifacts will be downloaded. To differentiate between downloaded artifacts, a directory denoted by the artifacts name will be created for each individual artifact. - +If the `name` input parameter is not provided, all artifacts will be downloaded. **To differentiate between downloaded artifacts, a directory denoted by the artifacts name will be created for each individual artifact.** Example, if there are two artifacts `Artifact-A` and `Artifact-B`, and the directory is `etc/usr/artifacts/`, the directory structure will look like this: ``` etc/usr/artifacts/ @@ -107,6 +106,24 @@ steps: run: ls -R ``` +# Download path output + +Not sure where your artifact was downloaded to? The `download-path` step output can help you out. Just make sure to be aware of the extra directory that is created if downloading all artifacts (no name specified). + +```yaml +steps: +- uses: actions/checkout@v2 + +- uses: actions/download-artifact@v2 + id: download + with: + name: 'my-artifact' + path: path/to/artifacts + +- name: 'Output download path' + run: echo ${{steps.download.outputs.download-path}} +``` + # @actions/artifact package Internally the [@actions/artifact](https://github.com/actions/toolkit/tree/master/packages/artifact) NPM package is used to interact with artifacts. You can find additional documentation there along with all the source code related to artifact download. diff --git a/dist/index.js b/dist/index.js index 4c56564..f981de3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6583,7 +6583,7 @@ var Inputs; })(Inputs = exports.Inputs || (exports.Inputs = {})); var Outputs; (function (Outputs) { - Outputs["DownloadPath"] = "downloadPath"; + Outputs["DownloadPath"] = "download-path"; })(Outputs = exports.Outputs || (exports.Outputs = {})); @@ -6641,8 +6641,6 @@ function run() { 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 diff --git a/src/constants.ts b/src/constants.ts index 913a33d..49d800a 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,5 +3,5 @@ export enum Inputs { Path = 'path' } export enum Outputs { - DownloadPath = 'downloadPath' + DownloadPath = 'download-path' } diff --git a/src/download-artifact.ts b/src/download-artifact.ts index e01cc45..90d78ca 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -8,9 +8,6 @@ async function run(): Promise { 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