|
13 | 13 | "markdownDescription": "Specification for pipeline configuration. Must be declared at the top of a configuration file, in a header section separated from the rest of the configuration with `---`. [Learn More](https://docs.gitlab.com/ci/yaml/#spec).", |
14 | 14 | "properties": { |
15 | 15 | "inputs": { |
16 | | - "$ref": "#/definitions/inputParameters" |
| 16 | + "$ref": "#/definitions/configInputs" |
17 | 17 | } |
18 | 18 | }, |
19 | 19 | "additionalProperties": false |
|
403 | 403 | } |
404 | 404 | ] |
405 | 405 | }, |
406 | | - "inputParameters": { |
| 406 | + "baseInput": { |
407 | 407 | "type": "object", |
408 | | - "markdownDescription": "Define parameters that can be populated in reusable CI/CD configuration files when added to a pipeline. [Learn More](https://docs.gitlab.com/ci/inputs/).", |
| 408 | + "properties": { |
| 409 | + "type": { |
| 410 | + "type": "string", |
| 411 | + "markdownDescription": "Input type. Defaults to 'string' when not specified.", |
| 412 | + "enum": [ |
| 413 | + "array", |
| 414 | + "boolean", |
| 415 | + "number", |
| 416 | + "string" |
| 417 | + ], |
| 418 | + "default": "string" |
| 419 | + }, |
| 420 | + "description": { |
| 421 | + "type": "string", |
| 422 | + "markdownDescription": "Human-readable explanation of the parameter.", |
| 423 | + "maxLength": 1024 |
| 424 | + }, |
| 425 | + "options": { |
| 426 | + "type": "array", |
| 427 | + "markdownDescription": "List of allowed values for this input.", |
| 428 | + "items": { |
| 429 | + "oneOf": [ |
| 430 | + { |
| 431 | + "type": "string" |
| 432 | + }, |
| 433 | + { |
| 434 | + "type": "number" |
| 435 | + }, |
| 436 | + { |
| 437 | + "type": "boolean" |
| 438 | + } |
| 439 | + ] |
| 440 | + } |
| 441 | + }, |
| 442 | + "regex": { |
| 443 | + "type": "string", |
| 444 | + "markdownDescription": "Regular expression that string values must match." |
| 445 | + }, |
| 446 | + "default": { |
| 447 | + "markdownDescription": "Default value for this input." |
| 448 | + } |
| 449 | + }, |
| 450 | + "additionalProperties": false |
| 451 | + }, |
| 452 | + "configInputs": { |
| 453 | + "type": "object", |
| 454 | + "markdownDescription": "Define input parameters for reusable CI/CD configuration. Config inputs can optionally specify defaults. [Learn More](https://docs.gitlab.com/ci/inputs/).", |
409 | 455 | "patternProperties": { |
410 | 456 | ".*": { |
411 | | - "markdownDescription": "**Input Configuration**\n\nAvailable properties:\n- `type`: string (default), array, boolean, or number\n- `description`: Human-readable explanation of the parameter (supports Markdown)\n- `options`: List of allowed values\n- `default`: Value to use when not specified (makes input optional)\n- `regex`: Pattern that string values must match", |
412 | 457 | "oneOf": [ |
413 | 458 | { |
414 | | - "type": "object", |
415 | | - "properties": { |
416 | | - "type": { |
417 | | - "type": "string", |
418 | | - "markdownDescription": "Force a specific input type. Defaults to 'string' when not specified. [Learn More](https://docs.gitlab.com/ci/inputs/#input-types).", |
419 | | - "enum": [ |
420 | | - "array", |
421 | | - "boolean", |
422 | | - "number", |
423 | | - "string" |
424 | | - ], |
425 | | - "default": "string" |
| 459 | + "allOf": [ |
| 460 | + { |
| 461 | + "$ref": "#/definitions/baseInput" |
426 | 462 | }, |
427 | | - "description": { |
428 | | - "type": "string", |
429 | | - "markdownDescription": "Give a description to a specific input. The description does not affect the input, but can help people understand the input details or expected values. Supports markdown.", |
430 | | - "maxLength": 1024 |
| 463 | + { |
| 464 | + "properties": { |
| 465 | + "rules": { |
| 466 | + "type": "array", |
| 467 | + "markdownDescription": "Conditional rules for this input.", |
| 468 | + "items": { |
| 469 | + "type": "object" |
| 470 | + } |
| 471 | + } |
| 472 | + } |
431 | 473 | }, |
432 | | - "options": { |
433 | | - "type": "array", |
434 | | - "markdownDescription": "Specify a list of allowed values for an input.", |
435 | | - "items": { |
436 | | - "oneOf": [ |
437 | | - { |
438 | | - "type": "string" |
| 474 | + { |
| 475 | + "allOf": [ |
| 476 | + { |
| 477 | + "if": { |
| 478 | + "properties": { |
| 479 | + "type": { |
| 480 | + "enum": ["string"] |
| 481 | + } |
| 482 | + } |
439 | 483 | }, |
440 | | - { |
441 | | - "type": "number" |
| 484 | + "then": { |
| 485 | + "properties": { |
| 486 | + "default": { |
| 487 | + "type": ["string", "null"] |
| 488 | + } |
| 489 | + } |
| 490 | + } |
| 491 | + }, |
| 492 | + { |
| 493 | + "if": { |
| 494 | + "properties": { |
| 495 | + "type": { |
| 496 | + "enum": ["number"] |
| 497 | + } |
| 498 | + } |
442 | 499 | }, |
443 | | - { |
444 | | - "type": "boolean" |
| 500 | + "then": { |
| 501 | + "properties": { |
| 502 | + "default": { |
| 503 | + "type": ["number", "null"] |
| 504 | + } |
| 505 | + } |
445 | 506 | } |
446 | | - ] |
447 | | - } |
448 | | - }, |
449 | | - "regex": { |
450 | | - "type": "string", |
451 | | - "markdownDescription": "Specify a regular expression that the input must match. Only impacts inputs with a `type` of `string`." |
452 | | - }, |
453 | | - "default": { |
454 | | - "markdownDescription": "Define default values for inputs when not specified. When you specify a default, the inputs are no longer mandatory." |
| 507 | + }, |
| 508 | + { |
| 509 | + "if": { |
| 510 | + "properties": { |
| 511 | + "type": { |
| 512 | + "enum": ["boolean"] |
| 513 | + } |
| 514 | + } |
| 515 | + }, |
| 516 | + "then": { |
| 517 | + "properties": { |
| 518 | + "default": { |
| 519 | + "type": ["boolean", "null"] |
| 520 | + } |
| 521 | + } |
| 522 | + } |
| 523 | + }, |
| 524 | + { |
| 525 | + "if": { |
| 526 | + "properties": { |
| 527 | + "type": { |
| 528 | + "enum": ["array"] |
| 529 | + } |
| 530 | + } |
| 531 | + }, |
| 532 | + "then": { |
| 533 | + "properties": { |
| 534 | + "default": { |
| 535 | + "oneOf": [ |
| 536 | + { |
| 537 | + "type": "array" |
| 538 | + }, |
| 539 | + { |
| 540 | + "type": "null" |
| 541 | + } |
| 542 | + ] |
| 543 | + } |
| 544 | + } |
| 545 | + } |
| 546 | + } |
| 547 | + ] |
455 | 548 | } |
456 | | - }, |
| 549 | + ] |
| 550 | + }, |
| 551 | + { |
| 552 | + "type": "null" |
| 553 | + } |
| 554 | + ] |
| 555 | + } |
| 556 | + } |
| 557 | + }, |
| 558 | + "jobInputs": { |
| 559 | + "type": "object", |
| 560 | + "markdownDescription": "Define input parameters for a job. Job inputs must always include a `default` value. [Learn More](https://docs.gitlab.com/ci/yaml/#inputs).", |
| 561 | + "patternProperties": { |
| 562 | + ".*": { |
| 563 | + "allOf": [ |
| 564 | + { |
| 565 | + "$ref": "#/definitions/baseInput" |
| 566 | + }, |
| 567 | + { |
| 568 | + "required": ["default"] |
| 569 | + }, |
| 570 | + { |
457 | 571 | "allOf": [ |
458 | 572 | { |
459 | 573 | "if": { |
460 | 574 | "properties": { |
461 | 575 | "type": { |
462 | | - "enum": [ |
463 | | - "string" |
464 | | - ] |
| 576 | + "enum": ["string"] |
465 | 577 | } |
466 | 578 | } |
467 | 579 | }, |
468 | 580 | "then": { |
469 | 581 | "properties": { |
470 | 582 | "default": { |
471 | | - "type": [ |
472 | | - "string", |
473 | | - "null" |
474 | | - ] |
| 583 | + "type": "string" |
475 | 584 | } |
476 | 585 | } |
477 | 586 | } |
|
480 | 589 | "if": { |
481 | 590 | "properties": { |
482 | 591 | "type": { |
483 | | - "enum": [ |
484 | | - "number" |
485 | | - ] |
| 592 | + "enum": ["number"] |
486 | 593 | } |
487 | 594 | } |
488 | 595 | }, |
489 | 596 | "then": { |
490 | 597 | "properties": { |
491 | 598 | "default": { |
492 | | - "type": [ |
493 | | - "number", |
494 | | - "null" |
495 | | - ] |
| 599 | + "type": "number" |
496 | 600 | } |
497 | 601 | } |
498 | 602 | } |
|
501 | 605 | "if": { |
502 | 606 | "properties": { |
503 | 607 | "type": { |
504 | | - "enum": [ |
505 | | - "boolean" |
506 | | - ] |
| 608 | + "enum": ["boolean"] |
507 | 609 | } |
508 | 610 | } |
509 | 611 | }, |
510 | 612 | "then": { |
511 | 613 | "properties": { |
512 | 614 | "default": { |
513 | | - "type": [ |
514 | | - "boolean", |
515 | | - "null" |
516 | | - ] |
| 615 | + "type": "boolean" |
517 | 616 | } |
518 | 617 | } |
519 | 618 | } |
|
522 | 621 | "if": { |
523 | 622 | "properties": { |
524 | 623 | "type": { |
525 | | - "enum": [ |
526 | | - "array" |
527 | | - ] |
| 624 | + "enum": ["array"] |
528 | 625 | } |
529 | 626 | } |
530 | 627 | }, |
531 | 628 | "then": { |
532 | 629 | "properties": { |
533 | 630 | "default": { |
534 | | - "oneOf": [ |
535 | | - { |
536 | | - "type": "array" |
537 | | - }, |
538 | | - { |
539 | | - "type": "null" |
540 | | - } |
541 | | - ] |
| 631 | + "type": "array" |
542 | 632 | } |
543 | 633 | } |
544 | 634 | } |
545 | 635 | } |
546 | | - ], |
547 | | - "additionalProperties": false |
548 | | - }, |
549 | | - { |
550 | | - "type": "null" |
| 636 | + ] |
551 | 637 | } |
552 | 638 | ] |
553 | 639 | } |
|
2089 | 2175 | "identity": { |
2090 | 2176 | "$ref": "#/definitions/identity" |
2091 | 2177 | }, |
| 2178 | + "inputs": { |
| 2179 | + "$ref": "#/definitions/jobInputs" |
| 2180 | + }, |
2092 | 2181 | "secrets": { |
2093 | 2182 | "$ref": "#/definitions/secrets" |
2094 | 2183 | }, |
|
0 commit comments