-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement array input type (#1261)
* refactor: better type safety * refactor: escaping " logic for include:inputs * refactor: * refactor: add types for InputTypes * refactor: helper function for exhaustive type checking in switch statement * feat: implement ci interpolation with arrays - https://docs.gitlab.com/ee/ci/yaml/inputs.html#array-type
- Loading branch information
Showing
8 changed files
with
149 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...-cases/include-inputs/input-templates/type-validation/array/.gitlab-ci-input-template.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
spec: | ||
inputs: | ||
array_input: | ||
type: array | ||
--- | ||
scan-website: | ||
script: | ||
- echo $[[ inputs.array_input]] |
7 changes: 7 additions & 0 deletions
7
tests/test-cases/include-inputs/input-templates/type-validation/array/.gitlab-ci.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
include: | ||
- local: '/.gitlab-ci-input-template.yml' | ||
inputs: | ||
array_input: "true" | ||
stages: | ||
- test |
13 changes: 13 additions & 0 deletions
13
tests/test-cases/include-inputs/input-templates/types/array/.gitlab-ci-input-template.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
spec: | ||
inputs: | ||
rules-config: | ||
type: array | ||
default: | ||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" | ||
when: manual | ||
- if: $CI_PIPELINE_SOURCE == "schedule" | ||
--- | ||
test_job: | ||
rules: $[[ inputs.rules-config ]] | ||
script: ls |
6 changes: 6 additions & 0 deletions
6
tests/test-cases/include-inputs/input-templates/types/array/.gitlab-ci.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
include: | ||
- local: '/.gitlab-ci-input-template.yml' | ||
|
||
stages: | ||
- test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters