From f20d35d09008a0474c85ddad323ae076e0339ba5 Mon Sep 17 00:00:00 2001 From: Miroslav Vadkerti Date: Wed, 14 Feb 2024 11:14:15 +0100 Subject: [PATCH] Do not set `test.fmf.name` attribute if `null` This is causing an issue for some of the users, if they do not set the plan regex: ``` Run sclorg/testing-farm-as-github-action@v2 19 Error: [ 20 { 21 "code": "too_small", 22 "minimum": 1, 23 "type": "string", 24 "inclusive": true, 25 "exact": false, 26 "message": "String must contain at least 1 character(s)", 27 "path": [ 28 "test", 29 "fmf", 30 "name" 31 ] 32 } 33] ``` From: https://github.com/osbuild/bootc-image-builder/actions/runs/7874729084/job/21520477899?pr=194 Signed-off-by: Miroslav Vadkerti --- src/action.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/action.ts b/src/action.ts index 058770e..ff58368 100644 --- a/src/action.ts +++ b/src/action.ts @@ -90,7 +90,8 @@ async function action(pr: PullRequest): Promise { fmf: { url: getInput('git_url', { required: true }), ref: getInput('git_ref'), - name: getInput('tmt_plan_regex'), + // Conditionally include the name attribute only if tmt_plan_regex is not null + ...(getInput('tmt_plan_regex') ? { name: getInput('tmt_plan_regex') } : {}), }, }, environments: [