skippedBy evaluates @skip and @include with the variables gh sent.
(dirs ast.DirectiveList, vars map[string]any)
| 346 | |
| 347 | // skippedBy evaluates @skip and @include with the variables gh sent. |
| 348 | func skippedBy(dirs ast.DirectiveList, vars map[string]any) bool { |
| 349 | if d := dirs.ForName("skip"); d != nil && condition(d, vars) { |
| 350 | return true |
| 351 | } |
| 352 | if d := dirs.ForName("include"); d != nil && !condition(d, vars) { |
| 353 | return true |
| 354 | } |
| 355 | return false |
| 356 | } |
| 357 | |
| 358 | func condition(d *ast.Directive, vars map[string]any) bool { |
| 359 | arg := d.Arguments.ForName("if") |