Skip to content

Commit fc169df

Browse files
committed
Add step validation details to README
1 parent a1fddee commit fc169df

1 file changed

Lines changed: 78 additions & 2 deletions

File tree

README.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,48 @@ This is a sub-section that provides configuration for running commands or trigge
7272
- [Group](https://buildkite.com/docs/pipelines/configure/step-types/group-step)
7373
- [Conditionals](https://buildkite.com/docs/pipelines/conditionals)
7474

75-
:warning: This plugin may accept configurations that are not valid pipeline steps, this is a known issue to keep its code simple and flexible.
75+
#### Step Validation
76+
77+
The plugin validates all step configurations before uploading the pipeline. Invalid steps are automatically skipped with a warning logged to the build output.
78+
79+
**A valid step must have:**
80+
- A `command` or `commands` field (for command steps), OR
81+
- A `trigger` field (for trigger steps), OR
82+
- A `group` field with either:
83+
- An action (`command`, `commands`, or `trigger`) directly on the group, OR
84+
- Valid nested `steps`
85+
86+
**Invalid configurations that will be skipped:**
87+
88+
```yaml
89+
# ❌ Empty step - no action defined
90+
- path: "app/"
91+
config:
92+
label: "Deploy app" # Only has a label, no command/trigger
93+
94+
# ❌ Empty group - no action and no nested steps
95+
- path: "services/"
96+
config:
97+
group: "Deploy"
98+
# Missing: steps array or action
99+
```
100+
101+
**Valid configurations:**
102+
103+
```yaml
104+
# ✅ Valid - has command
105+
- path: "app/"
106+
config:
107+
label: "Deploy app"
108+
command: "echo deploying"
109+
110+
# ✅ Valid - group with nested steps
111+
- path: "services/"
112+
config:
113+
group: "Deploy"
114+
steps:
115+
- command: "deploy.sh"
116+
```
76117

77118
```yaml
78119
steps:
@@ -89,7 +130,7 @@ steps:
89130
- path: docker/
90131
config:
91132
group: docker/**
92-
steps:
133+
steps: # Required: groups must have either 'steps' or an action
93134
- plugins:
94135
- docker#latest:
95136
build: service
@@ -489,6 +530,41 @@ steps:
489530
command: "echo deploy-bar"
490531
```
491532

533+
## Troubleshooting
534+
535+
### "Skipping invalid step" warnings
536+
537+
If you see warnings like `Skipping invalid step: empty step configuration`, check that your step configuration includes:
538+
539+
1. For command steps: `command` or `commands` field
540+
2. For trigger steps: `trigger` field
541+
3. For group steps: `group` field with either `steps` array or an action
542+
543+
**Common issues:**
544+
545+
- Forgetting to add `command:` or `trigger:` inside the `config` block
546+
- Creating empty groups without nested steps
547+
- Using only metadata fields like `label`, `key`, or `env` without an action
548+
549+
**Example of fixing an invalid configuration:**
550+
551+
```yaml
552+
# ❌ Invalid - missing action
553+
- path: "app/"
554+
config:
555+
label: "Deploy app"
556+
env:
557+
- ENV=production
558+
559+
# ✅ Fixed - added command
560+
- path: "app/"
561+
config:
562+
label: "Deploy app"
563+
command: "deploy.sh"
564+
env:
565+
- ENV=production
566+
```
567+
492568
## Compatibility
493569

494570
| Elastic Stack | Agent Stack K8s | Hosted (Mac) | Hosted (Linux) | Notes |

0 commit comments

Comments
 (0)