Files
Proxmox-AIS-Server/ci/publish-policy.sh
T
BartelLuis 9c528c6eca
CI / container-policy (push) Successful in 8s
CI / javascript-check (push) Successful in 18s
CI / python-tests (push) Failing after 4m44s
CI / container-verify (push) Skipped
CI / container-publish (push) Skipped
ci: migrate workflows to Gitea Actions
2026-09-14 20:23:20 +02:00

31 lines
1.0 KiB
Bash

#!/bin/sh
# Gitea 1.27 does not populate ref_protected. Repository administrators opt in
# after configuring branch/tag protection and package credentials in Gitea.
set -eu
publish=false
if [ "${PUBLISH_IMAGES:-}" = true ]; then
case "${GITHUB_EVENT_NAME:-}" in
push|workflow_dispatch)
case "${GITHUB_REF_TYPE:-}" in
branch)
if [ -n "${DEFAULT_BRANCH:-}" ] && [ "${GITHUB_REF_NAME:-}" = "$DEFAULT_BRANCH" ]; then
publish=true
fi
;;
tag)
case "${GITHUB_REF_NAME:-}" in
''|*[!v0-9.]*) ;;
*)
if printf '%s\n' "$GITHUB_REF_NAME" | grep -Eq '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'; then
publish=true
fi
;;
esac
;;
esac
;;
esac
fi
printf '%s\n' "$publish"