Skip to content

Commit

Permalink
Do not set test.fmf.name attribute if null (#117)
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 <[email protected]>
  • Loading branch information
thrix authored Feb 14, 2024
1 parent 714c5e6 commit 82d1bb9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
6 changes: 1 addition & 5 deletions dist/action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ 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 82d1bb9

Please sign in to comment.