branch first
This commit is contained in:
parent
60f1a717c5
commit
88cb222ebe
1 changed files with 12 additions and 12 deletions
24
spcd.sh
24
spcd.sh
|
@ -56,6 +56,12 @@ spcd_set_environment_variables() {
|
||||||
spcd_step "Set environment variables"
|
spcd_step "Set environment variables"
|
||||||
# continuous integration / github → gitea → forgejo
|
# continuous integration / github → gitea → forgejo
|
||||||
if [ -n "${GITHUB_ACTIONS}" ]; then
|
if [ -n "${GITHUB_ACTIONS}" ]; then
|
||||||
|
# project branch
|
||||||
|
if [ -n "${GITHUB_REF_NAME}" ]; then
|
||||||
|
SPCD_PROJECT_BRANCH="${GITHUB_REF_NAME}"
|
||||||
|
else
|
||||||
|
spcd_error_ci "GITHUB_REF_NAME"
|
||||||
|
fi
|
||||||
# project root
|
# project root
|
||||||
if [ -n "${GITHUB_SERVER_URL}" ]; then
|
if [ -n "${GITHUB_SERVER_URL}" ]; then
|
||||||
SPCD_PROJECT_ROOT="$(dirname "${GITHUB_SERVER_URL}")//"
|
SPCD_PROJECT_ROOT="$(dirname "${GITHUB_SERVER_URL}")//"
|
||||||
|
@ -74,14 +80,14 @@ spcd_set_environment_variables() {
|
||||||
else
|
else
|
||||||
spcd_error_ci "GITHUB_REPOSITORY"
|
spcd_error_ci "GITHUB_REPOSITORY"
|
||||||
fi
|
fi
|
||||||
# project branch
|
|
||||||
if [ -n "${GITHUB_REF_NAME}" ]; then
|
|
||||||
SPCD_PROJECT_BRANCH="${GITHUB_REF_NAME}"
|
|
||||||
else
|
|
||||||
spcd_error_ci "GITHUB_REF_NAME"
|
|
||||||
fi
|
|
||||||
# continuous integration / gitlab
|
# continuous integration / gitlab
|
||||||
elif [ -n "${GITLAB_CI}" ]; then
|
elif [ -n "${GITLAB_CI}" ]; then
|
||||||
|
# project branch
|
||||||
|
if [ -n "${CI_COMMIT_BRANCH}" ]; then
|
||||||
|
SPCD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}"
|
||||||
|
else
|
||||||
|
spcd_error_ci "CI_COMMIT_BRANCH"
|
||||||
|
fi
|
||||||
# project root / protocol
|
# project root / protocol
|
||||||
if [ -n "${CI_SERVER_PROTOCOL}" ]; then
|
if [ -n "${CI_SERVER_PROTOCOL}" ]; then
|
||||||
# project root / login
|
# project root / login
|
||||||
|
@ -117,12 +123,6 @@ spcd_set_environment_variables() {
|
||||||
else
|
else
|
||||||
spcd_error_ci "CI_SERVER_PROTOCOL"
|
spcd_error_ci "CI_SERVER_PROTOCOL"
|
||||||
fi
|
fi
|
||||||
# project branch
|
|
||||||
if [ -n "${CI_COMMIT_BRANCH}" ]; then
|
|
||||||
SPCD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}"
|
|
||||||
else
|
|
||||||
spcd_error_ci "CI_COMMIT_BRANCH"
|
|
||||||
fi
|
|
||||||
# continuous integration / unsupported
|
# continuous integration / unsupported
|
||||||
else
|
else
|
||||||
spcd_error_ci "ø"
|
spcd_error_ci "ø"
|
||||||
|
|
Loading…
Reference in a new issue