Skip to content

Invalid JSON in options error when omitting the options input entirely #77

@SimJoSt

Description

@SimJoSt

When calling the deployer GitHub action without setting any values for the options input, the following error message appears: Invalid JSON in options
It doesn't break the deployment, however an error message in a successful deployment log feels weird :) And with no actual problems occurring, I was wondering if the error detection is slightly off.
I'm not familiar with the try-catch logic yet, so I cannot provide and improvement as a PR at this time.

Relevant code snippet:

action/index.js

Lines 116 to 126 in 06aeb29

let options = []
try {
let optionsArg = core.getInput('options')
if (optionsArg !== '') {
for (let [key, value] in Object.entries(JSON.parse(optionsArg))) {
options.push('-o', `${key}=${value}`)
}
}
} catch (e) {
console.error('Invalid JSON in options')
}

Readme section:

action/README.md

Lines 26 to 29 in 06aeb29

# Config options for the Deployer. Same as the `-o` flag in the CLI.
# Optional.
options:
keep_releases: 7

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions