diff --git a/README.md b/README.md index a6463236..8bc2a73c 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ The following settings must be passed as environment variables as shown in the e ## Action outputs -| name | description | -| ------------------ | --------------------------------------------------------------------------------------- | -| `object_key` | Uploaded object key generated by [shortid](https://github.com/dylang/shortid) in Bucket | -| `object_locations` | Object Locations | +| name | description | +| ------------------ | --------------------------------------------------------------------------------------------- | +| `object_key` | Uploaded object key generated by [shortid](https://github.com/dylang/shortid) in Bucket | +| `object_locations` | The URLs of the uploaded objects as a JSON string. E.g: `["location/file1","location/file2"]` | diff --git a/index.js b/index.js index b1b6162f..4f213d4c 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +// @ts-check const core = require('@actions/core'); const S3 = require('aws-sdk/clients/s3'); const fs = require('fs'); @@ -34,7 +35,7 @@ const paths = klawSync(SOURCE_DIR, { function upload(params) { return new Promise(resolve => { s3.upload(params, (err, data) => { - if (err) core.error(err); + if (err) core.error(err.message); core.info(`uploaded - ${data.Key}`); core.info(`located - ${data.Location}`); resolve(data.Location); @@ -63,7 +64,7 @@ run() core.info(`object key - ${objKey}`); core.info(`object locations - ${locations}`); core.setOutput('object_key', objKey); - core.setOutput('object_locations', locations); + core.setOutput('object_locations', JSON.stringify(locations)); }) .catch(err => { core.error(err);