More when filters (#3407)

to not run empty pipelines
This commit is contained in:
qwerty287 2024-02-23 06:05:25 +01:00 committed by GitHub
parent de5c65939a
commit 901315625b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 24 deletions

View file

@ -1,11 +1,3 @@
when:
- event: [pull_request, tag]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- release/*
- renovate/*
variables: variables:
- &golang_image 'docker.io/golang:1.22.0' - &golang_image 'docker.io/golang:1.22.0'
- &node_image 'docker.io/node:21-alpine' - &node_image 'docker.io/node:21-alpine'
@ -46,6 +38,15 @@ variables:
# pipeline config changes # pipeline config changes
- '.woodpecker/docker.yaml' - '.woodpecker/docker.yaml'
when:
- event: [pull_request, tag]
- event: push
branch:
- renovate/*
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
steps: steps:
vendor: vendor:
image: *golang_image image: *golang_image
@ -59,7 +60,6 @@ steps:
path: *when_path path: *when_path
- branch: - branch:
- ${CI_REPO_DEFAULT_BRANCH} - ${CI_REPO_DEFAULT_BRANCH}
- release/*
- renovate/* - renovate/*
event: [push, tag] event: [push, tag]
path: *when_path path: *when_path
@ -81,7 +81,6 @@ steps:
path: *when_path path: *when_path
- branch: - branch:
- ${CI_REPO_DEFAULT_BRANCH} - ${CI_REPO_DEFAULT_BRANCH}
- release/*
- renovate/* - renovate/*
event: [push, tag] event: [push, tag]
path: *when_path path: *when_path
@ -107,9 +106,7 @@ steps:
path: *when_path path: *when_path
- event: push - event: push
path: *when_path path: *when_path
branch: branch: renovate/*
- release/*
- renovate/*
cross-compile-server: cross-compile-server:
depends_on: depends_on:
@ -175,9 +172,7 @@ steps:
path: *when_path path: *when_path
- event: push - event: push
path: *when_path path: *when_path
branch: branch: renovate/*
- release/*
- renovate/*
publish-next-server: publish-next-server:
depends_on: depends_on:

View file

@ -1,10 +1,3 @@
when:
- event: pull_request
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- renovate/*
variables: variables:
- &golang_image 'docker.io/golang:1.21.5' - &golang_image 'docker.io/golang:1.21.5'
- &when - &when
@ -21,6 +14,14 @@ variables:
branch: renovate/* branch: renovate/*
path: *when_path path: *when_path
when:
- event: pull_request
- event: push
branch: renovate/*
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
steps: steps:
vendor: vendor:
image: *golang_image image: *golang_image

View file

@ -2,7 +2,6 @@ when:
- event: pull_request - event: pull_request
- event: push - event: push
branch: branch:
- ${CI_REPO_DEFAULT_BRANCH}
- release/* - release/*
- renovate/* - renovate/*