Skip to content

Commit

Permalink
shallwefootballGH-9: Fixed type errors.
Browse files Browse the repository at this point in the history
 - Log the `message` of the  `Error` object.
 - Streamlined output to string for `fromjson`.
 - Aligned the documenation with the new `object_locations`value.
 - Regenerated `dist`.

Closes shallwefootball#9

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta committed Jul 2, 2020
1 parent 7ca30b1 commit f8905af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]` |
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,7 @@ AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, {
/***/ 104:
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {

// @ts-check
const core = __webpack_require__(470);
const S3 = __webpack_require__(777);
const fs = __webpack_require__(747);
Expand Down Expand Up @@ -2430,7 +2431,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);
Expand Down Expand Up @@ -2459,7 +2460,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);
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
const core = require('@actions/core');
const S3 = require('aws-sdk/clients/s3');
const fs = require('fs');
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f8905af

Please sign in to comment.