mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 19:31:05 +00:00
make event in pipeline schema also a constraint_list (#3082)
This commit is contained in:
parent
38cf248e41
commit
8b47b3a978
3 changed files with 60 additions and 12 deletions
|
@ -10,6 +10,9 @@ when:
|
|||
cron:
|
||||
include:
|
||||
- hello
|
||||
- event:
|
||||
exclude: pull_request_closed
|
||||
evaluate: 'CI_COMMIT_AUTHOR == "woodpecker-ci"'
|
||||
|
||||
steps:
|
||||
echo:
|
||||
|
|
|
@ -27,6 +27,14 @@ steps:
|
|||
when:
|
||||
event: [push, pull_request, tag, deployment]
|
||||
|
||||
when-event-exclude-pull_request_closed:
|
||||
image: alpine
|
||||
commands:
|
||||
- echo "test"
|
||||
when:
|
||||
event:
|
||||
exclude: pull_request_closed
|
||||
|
||||
when-ref:
|
||||
image: alpine
|
||||
commands:
|
||||
|
|
|
@ -394,18 +394,7 @@
|
|||
},
|
||||
"event": {
|
||||
"description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#event",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"minLength": 1,
|
||||
"items": {
|
||||
"$ref": "#/definitions/event_enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/event_enum"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/event_constraint_list"
|
||||
},
|
||||
"ref": {
|
||||
"description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#ref",
|
||||
|
@ -495,6 +484,54 @@
|
|||
"event_enum": {
|
||||
"enum": ["push", "pull_request", "pull_request_closed", "tag", "deployment", "cron", "manual"]
|
||||
},
|
||||
"event_constraint_list": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/event_enum"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"minLength": 1,
|
||||
"items": {
|
||||
"$ref": "#/definitions/event_enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"include": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/event_enum"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"minLength": 1,
|
||||
"items": {
|
||||
"$ref": "#/definitions/event_enum"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"exclude": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/event_enum"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"minLength": 1,
|
||||
"items": {
|
||||
"$ref": "#/definitions/event_enum"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"constraint_list": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue