Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Commit

Permalink
fix: Check arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
floric committed Aug 1, 2020
1 parent bdb1964 commit 9cc1a49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/update-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run: |
SIZE=($(du -s dist/))
echo "::set-env name=CODE_SIZE::$SIZE"
- uses: floric/[email protected].8
- uses: floric/[email protected].9
name: Update Report
with:
key: code-size
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ async function runAction() {
const context = github_1.getContext();
const key = core.getInput("key");
const value = core.getInput("value");
if (!!key || Number.isNaN(Number.parseFloat(value))) {
throw new Error("Invalid arguments delivered");
}
const path = `data/values/${new Date().getUTCFullYear()}/${key}.json`;
const releaseId = await createRelease(context);
const { serializedData, existingSha } = await github_1.getContent(context, path);
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ async function runAction() {
const context = getContext();
const key = core.getInput("key");
const value = core.getInput("value");
if (!!key || Number.isNaN(Number.parseFloat(value))) {
throw new Error("Invalid arguments delivered");
}
const path = `data/values/${new Date().getUTCFullYear()}/${key}.json`;

const releaseId = await createRelease(context);
Expand Down

0 comments on commit 9cc1a49

Please sign in to comment.