rename: PUBLISH_REPO to PUBLISH_REPOSITORY

This commit is contained in:
peaceiris 2019-09-27 14:41:01 +09:00
parent 60eb903bb7
commit 6ea8776db8

View File

@ -17,9 +17,9 @@ function skip() {
} }
# check values # check values
if [ -z "${PUBLISH_REPO}" ]; then if [ -z "${PUBLISH_REPOSITORY}" ]; then
print_info "setup with PUBLISH_REPO = GITHUB_REPOSITORY" print_info "setup with PUBLISH_REPOSITORY = GITHUB_REPOSITORY"
PUBLISH_REPO=GITHUB_REPOSITORY PUBLISH_REPOSITORY=${GITHUB_REPOSITORY}
fi fi
if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
@ -31,23 +31,23 @@ if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
echo "${ACTIONS_DEPLOY_KEY}" > /root/.ssh/id_rsa echo "${ACTIONS_DEPLOY_KEY}" > /root/.ssh/id_rsa
chmod 400 /root/.ssh/id_rsa chmod 400 /root/.ssh/id_rsa
remote_repo="git@github.com:${PUBLISH_REPO}.git" remote_repo="git@github.com:${PUBLISH_REPOSITORY}.git"
elif [ -n "${PERSONAL_TOKEN}" ]; then elif [ -n "${PERSONAL_TOKEN}" ]; then
print_info "setup with PERSONAL_TOKEN" print_info "setup with PERSONAL_TOKEN"
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${PUBLISH_REPO}.git" remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${PUBLISH_REPOSITORY}.git"
elif [ -n "${GITHUB_TOKEN}" ]; then elif [ -n "${GITHUB_TOKEN}" ]; then
print_info "setup with GITHUB_TOKEN" print_info "setup with GITHUB_TOKEN"
print_error "Do not use GITHUB_TOKEN, See #9" print_error "Do not use GITHUB_TOKEN, See #9"
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${PUBLISH_REPO}.git" remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${PUBLISH_REPOSITORY}.git"
if [ -n "${PUBLISH_REPO}" ]; then if [ -n "${PUBLISH_REPOSITORY}" ]; then
if [ "${GITHUB_REPOSITORY}" != "${PUBLISH_REPO}" ]; then if [ "${GITHUB_REPOSITORY}" != "${PUBLISH_REPOSITORY}" ]; then
echo "can not use GITHUB_TOKEN to deploy to a different repository" echo "can not use GITHUB_TOKEN to deploy to a different repository"
exit 1 exit 1
fi fi