diff --git a/README.md b/README.md index 3771474..5eebf4b 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ steps: # 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). +The `download-path` step output contains information regarding where the artifact was downloaded to. This output can be used for a variety of purposes such as logging or as input to other actions. Be aware of the extra directory that is created if downloading all artifacts (no name specified). ```yaml steps: @@ -120,10 +120,12 @@ steps: name: 'my-artifact' path: path/to/artifacts -- name: 'Output download path' +- name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} ``` +> Note: The `id` defined in the `download/artifact` step must match the `id` defined in the `echo` step (i.e `steps.[ID].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 f981de3..15e1e91 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6662,6 +6662,7 @@ function run() { core.info(`Artifact ${downloadResponse.artifactName} was downloaded to ${downloadResponse.downloadPath}`); } // output the directory that the artifact(s) was/were downloaded to + // if no path is provided, an empty string resolves to the current working directory core.setOutput(constants_1.Outputs.DownloadPath, path_1.resolve(path)); core.info('Artifact download has finished successfully'); } diff --git a/package-lock.json b/package-lock.json index 7fcb57e..c36e40a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -185,9 +185,9 @@ "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==", + "version": "12.12.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz", + "integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==", "dev": true }, "@types/normalize-package-data": { diff --git a/package.json b/package.json index d2211db..15d5b82 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@actions/artifact": "^0.3.1", "@actions/core": "^1.2.4", - "@types/node": "^14.0.22", + "@types/node": "^12.12.6", "@typescript-eslint/parser": "^2.30.0", "@zeit/ncc": "^0.22.1", "concurrently": "^5.2.0", diff --git a/src/download-artifact.ts b/src/download-artifact.ts index 90d78ca..f24656a 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -38,6 +38,7 @@ async function run(): Promise { ) } // output the directory that the artifact(s) was/were downloaded to + // if no path is provided, an empty string resolves to the current working directory core.setOutput(Outputs.DownloadPath, resolve(path)) core.info('Artifact download has finished successfully') } catch (err) {