Skip to content

feat: add fail_on_error input#100

Merged
martin-mfg merged 2 commits into
stats-organization:mainfrom
marcalexiei:fail-on-error
Jul 23, 2026
Merged

feat: add fail_on_error input#100
martin-mfg merged 2 commits into
stats-organization:mainfrom
marcalexiei:fail-on-error

Conversation

@marcalexiei

Copy link
Copy Markdown
Contributor

The renderer returns a "Something went wrong" SVG on fetch failures instead of throwing, so the action used to exit green with a broken card.

Adds an opt-in fail_on_error input (default false).
When true, the action fails on an error status instead of writing the card.
Default is unchanged; this behaviour is backwards compatible.

  • action.yml: new input, wired to INPUT_FAIL_ON_ERROR
  • index.js: setFailed on error status when enabled
  • README.md: document the input
  • tests/e2e.test.js: cover fail path and default write path

Comment thread index.js
Comment on lines -184 to -186
const optionsInput = getInput("options") || "";
const optionsInput = getInput("options");
const outputPathInput = getInput("path");
const coreVersion = validateCoreVersion(getInput("core_version") || "");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the || "" since the getInput JSDoc states:

Returns an empty string if the value is not defined.

Reference: https://github.com/actions/toolkit/blob/e7728b1bcda3082eca6b716f0c6e20c743b7972d/packages/core/src/core.ts#L142-L146

@martin-mfg
martin-mfg merged commit 7d001ba into stats-organization:main Jul 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action succeeds even when card data fetching fails

2 participants