diff --git a/README.md b/README.md index e5b78e1..79bfed3 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,11 @@ Docker :whale: image is also provided and automatically updated within [Docker H Following inputs can be used as `step.with` keys -| Name | Type | Description | -|-----------------|---------|-----------------------------------------------------------------| -| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) | -| `build_dir` | String | Path to build directory to deploy | +| Name | Type | Description | +|-----------------|---------|-----------------------------------------------------------------------------------------| +| `repo` | String | GitHub repository where assets will be deployed. Example: portapps/portapps.github.io | +| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) | +| `build_dir` | String | Path to build directory to deploy | ### environment variables diff --git a/action.yml b/action.yml index 62dd549..9d9a0ff 100644 --- a/action.yml +++ b/action.yml @@ -7,9 +7,10 @@ branding: icon: 'upload-cloud' inputs: + repo: + description: 'GitHub repository where assets will be deployed. Example: portapps/portapps.github.io' target_branch: description: 'Git branch where assets will be deployed' - required: false default: 'gh-pages' build_dir: description: 'Path to build directory to deploy' diff --git a/entrypoint.sh b/entrypoint.sh index f8d4a47..218c65d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e +REPO=${INPUT_REPO:-$GITHUB_REPOSITORY} + if [ -z "$INPUT_TARGET_BRANCH" ]; then echo "⛔️ Target branch not defined" exit 1 @@ -18,7 +20,7 @@ git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" git add . git commit --allow-empty -m 'Deploy to GitHub pages' -git push --force --quiet https://${GITHUB_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${GITHUB_REPOSITORY}.git master:${INPUT_TARGET_BRANCH} +git push --force --quiet "https://${GITHUB_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${REPO}.git" "master:${INPUT_TARGET_BRANCH}" rm -rf .git # Tried https://developer.github.com/v3/repos/pages/#request-a-page-build