From c7935221e6a50a8f00bfb147caa6f98b75cf7128 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Wed, 12 Nov 2025 14:09:45 +0100 Subject: [PATCH] feat: add validation for the `collapsed` input parameter Generated-by: Claude Sonnet 4.5 --- dist/index.js | 4 ++++ src/main.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/dist/index.js b/dist/index.js index 3687bbd..cdd6319 100644 --- a/dist/index.js +++ b/dist/index.js @@ -323,6 +323,10 @@ class TestReporter { core.setFailed(`Input parameter 'list-tests' has invalid value`); return; } + if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') { + core.setFailed(`Input parameter 'collapsed' has invalid value`); + return; + } if (isNaN(this.maxAnnotations) || this.maxAnnotations < 0 || this.maxAnnotations > 50) { core.setFailed(`Input parameter 'max-annotations' has invalid value`); return; diff --git a/src/main.ts b/src/main.ts index 1dccea7..218377f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -67,6 +67,11 @@ class TestReporter { return } + if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') { + core.setFailed(`Input parameter 'collapsed' has invalid value`) + return + } + if (isNaN(this.maxAnnotations) || this.maxAnnotations < 0 || this.maxAnnotations > 50) { core.setFailed(`Input parameter 'max-annotations' has invalid value`) return