diff --git a/README.md b/README.md index 184bf2c..2b615b2 100644 --- a/README.md +++ b/README.md @@ -218,9 +218,9 @@ For example: keepFiles: true ``` -#### ⭐️ Publish to other repository +#### ⭐️ Deploy to external repository -By default, the files are published to the respository which is running this action. If you want to publish to another repository on GitHub set the environment variable `PUBLISH_REPO` to `/`. +By default, the files are published to the respository which is running this action. If you want to publish to another repository on GitHub set the environment variable `EXTERNAL_REPOSITORY` to `/`. For example: @@ -229,7 +229,7 @@ For example: uses: peaceiris/actions-gh-pages@v2.4.0 env: ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} - PUBLISH_REPO: peaceiris/peaceiris.github.io + EXTERNAL_REPOSITORY: peaceiris/peaceiris.github.io PUBLISH_BRANCH: master PUBLISH_DIR: ./public ``` diff --git a/entrypoint.sh b/entrypoint.sh index ec5e7c8..ae1d932 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,10 +17,12 @@ function skip() { } # check values -if [ -z "${PUBLISH_REPOSITORY}" ]; then - print_info "setup with PUBLISH_REPOSITORY = GITHUB_REPOSITORY" +if [ -n "${EXTERNAL_REPOSITORY}" ]; then + PUBLISH_REPOSITORY=${EXTERNAL_REPOSITORY} +else PUBLISH_REPOSITORY=${GITHUB_REPOSITORY} fi +print_info "Deploy to ${PUBLISH_REPOSITORY}" if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then