mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 13:34:45 +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:
|
cron:
|
||||||
include:
|
include:
|
||||||
- hello
|
- hello
|
||||||
|
- event:
|
||||||
|
exclude: pull_request_closed
|
||||||
|
evaluate: 'CI_COMMIT_AUTHOR == "woodpecker-ci"'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
echo:
|
echo:
|
||||||
|
|
|
@ -27,6 +27,14 @@ steps:
|
||||||
when:
|
when:
|
||||||
event: [push, pull_request, tag, deployment]
|
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:
|
when-ref:
|
||||||
image: alpine
|
image: alpine
|
||||||
commands:
|
commands:
|
||||||
|
|
|
@ -394,18 +394,7 @@
|
||||||
},
|
},
|
||||||
"event": {
|
"event": {
|
||||||
"description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#event",
|
"description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#event",
|
||||||
"oneOf": [
|
"$ref": "#/definitions/event_constraint_list"
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"minLength": 1,
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/event_enum"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/event_enum"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"ref": {
|
"ref": {
|
||||||
"description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#ref",
|
"description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#ref",
|
||||||
|
@ -495,6 +484,54 @@
|
||||||
"event_enum": {
|
"event_enum": {
|
||||||
"enum": ["push", "pull_request", "pull_request_closed", "tag", "deployment", "cron", "manual"]
|
"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": {
|
"constraint_list": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue