mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-15 22:56:54 +08:00
enhance: error handling EXTERNAL_REPOSITORY with GITHUB_TOKEN
This commit is contained in:
parent
34d447917a
commit
954d420fb6
@ -46,15 +46,13 @@ 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_REPOSITORY}.git"
|
if [ -n "${EXTERNAL_REPOSITORY}" ]; then
|
||||||
|
print_error "can not use GITHUB_TOKEN to deploy to a external repository"
|
||||||
if [ -n "${PUBLISH_REPOSITORY}" ]; then
|
exit 1
|
||||||
if [ "${GITHUB_REPOSITORY}" != "${PUBLISH_REPOSITORY}" ]; then
|
|
||||||
echo "can not use GITHUB_TOKEN to deploy to a different repository"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${PUBLISH_REPOSITORY}.git"
|
||||||
|
|
||||||
else
|
else
|
||||||
print_error "not found ACTIONS_DEPLOY_KEY, PERSONAL_TOKEN, or GITHUB_TOKEN"
|
print_error "not found ACTIONS_DEPLOY_KEY, PERSONAL_TOKEN, or GITHUB_TOKEN"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user