Skip to content

Commit

Permalink
Do not set test.fmf.name attribute if null
Browse files Browse the repository at this point in the history
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 <mvadkert@redhat.com>
  • Loading branch information
thrix committed Feb 14, 2024
1 parent 714c5e6 commit f20d35d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ async function action(pr: PullRequest): Promise<void> {
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: [
Expand Down

0 comments on commit f20d35d

Please sign in to comment.