Skip to content

Commit

Permalink
Update meta-data key to meta-data in input and output
Browse files Browse the repository at this point in the history
  • Loading branch information
usualdesigner committed Mar 1, 2024
1 parent 1b4abaa commit 694e943
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Main test suite", () => {
return "test";
case "file":
return "file.txt";
case "metadata":
case "meta-data":
return '{"key1": "value1", "key2": "value2"}';
default:
return "";
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ inputs:
prefix:
description: S3 Object Prefix
required: false
meta-data:
description: S3 Object Metadata
required: false

outputs:
output:
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ const handleInput = (): {
required: false,
});

const metaData = core.getInput("metadata", {
const metaData = core.getInput("meta-data", {
required: false,
});

const metaDataObject = JSON.parse(metaData);
let metaDataObject = {};

try {
metaDataObject = JSON.parse(metaData);
} catch (error: unknown) {
core.info("Error parsing meta-data");
}

return {
bucketName,
Expand Down

0 comments on commit 694e943

Please sign in to comment.