[chore/cicd] Account for force pushes in conditional runs (#4121)

CI_PIPELINE_FILES seems to be empty on force pushes to an open pull request, so this PR just accounts for that and runs all steps if it's the case, as we can't tell then what's actually changed.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4121
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
tobi 2025-05-04 07:58:17 +00:00 committed by tobi
commit 056c67f396
2 changed files with 50 additions and 4 deletions

View file

@ -15,10 +15,23 @@ steps:
snapshot:
# Snapshot only if some interesting
# source code files have changed.
#
# CI_PIPELINE_FILES is undefined if
# files changed > 500, so account for
# this and snapshot anyway if so.
when:
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
- evaluate: '(not ("CI_PIPELINE_FILES" in $env)) || any(fromJSON(CI_PIPELINE_FILES), { # startsWith "internal/" || # startsWith "cmd/" || # startsWith "testrig/" || # startsWith "vendor/" || # startsWith "web/" || # == "Dockerfile" })'
- evaluate: >-
(not ("CI_PIPELINE_FILES" in $env)) ||
any(fromJSON(CI_PIPELINE_FILES), {
# startsWith "internal/" ||
# startsWith "cmd/" ||
# startsWith "testrig/" ||
# startsWith "vendor/" ||
# startsWith "web/" ||
# == "Dockerfile"
})
# https://codeberg.org/superseriousbusiness/gotosocial-woodpecker-build
image: superseriousbusiness/gotosocial-woodpecker-build:0.10.0