fix(provision): use $USERNAME/$EMAIL directly — Woodpecker 3.x env vars

Woodpecker 3.x exposes pipeline variables with their original key names
(USERNAME, EMAIL), not CI_PIPELINE_VARIABLE_ prefix.
This commit is contained in:
Viktor Barzin 2026-03-18 00:04:51 +00:00
parent 52dc657af5
commit 7a24ff6702

View file

@ -12,16 +12,10 @@ steps:
- name: validate-inputs
image: alpine
commands:
- env | grep -i "CI_\|USERNAME\|EMAIL\|PROVISION" | sort || true
- |
USERNAME="$CI_PIPELINE_VARIABLE_USERNAME"
EMAIL="$CI_PIPELINE_VARIABLE_EMAIL"
# Fallback: try without VARIABLE_ prefix (Woodpecker 3.x may use different format)
[ -z "$USERNAME" ] && USERNAME="$CI_PIPELINE_DEPLOY_TASK"
echo "DEBUG: USERNAME=$USERNAME EMAIL=$EMAIL"
echo "DEBUG: All CI vars:" && env | grep ^CI_ | sort
if [ -z "$USERNAME" ] || [ -z "$EMAIL" ]; then
echo "ERROR: USERNAME and EMAIL variables are required"
echo "Trigger with: POST /api/repos/1/pipelines {branch:master, variables:{USERNAME:x, EMAIL:y}}"
exit 1
fi
echo "Provisioning user: $USERNAME ($EMAIL)"