Skip to content

Commit 08d0501

Browse files
committed
Add repo input
1 parent 068e494 commit 08d0501

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ Docker :whale: image is also provided and automatically updated within [Docker H
7070
7171
Following inputs can be used as `step.with` keys
7272

73-
| Name | Type | Description |
74-
|-----------------|---------|-----------------------------------------------------------------|
75-
| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) |
76-
| `build_dir` | String | Path to build directory to deploy |
73+
| Name | Type | Description |
74+
|-----------------|---------|-----------------------------------------------------------------------------------------|
75+
| `repo` | String | GitHub repository where assets will be deployed. Example: portapps/portapps.github.io |
76+
| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) |
77+
| `build_dir` | String | Path to build directory to deploy |
7778

7879
### environment variables
7980

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ branding:
77
icon: 'upload-cloud'
88

99
inputs:
10+
repo:
11+
description: 'GitHub repository where assets will be deployed. Example: portapps/portapps.github.io'
1012
target_branch:
1113
description: 'Git branch where assets will be deployed'
12-
required: false
1314
default: 'gh-pages'
1415
build_dir:
1516
description: 'Path to build directory to deploy'

entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22
set -e
33

4+
REPO=${INPUT_REPO:-$GITHUB_REPOSITORY}
5+
46
if [ -z "$INPUT_TARGET_BRANCH" ]; then
57
echo "⛔️ Target branch not defined"
68
exit 1
@@ -18,7 +20,7 @@ git config user.name "${GITHUB_ACTOR}"
1820
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
1921
git add .
2022
git commit --allow-empty -m 'Deploy to GitHub pages'
21-
git push --force --quiet https://${GITHUB_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${GITHUB_REPOSITORY}.git master:${INPUT_TARGET_BRANCH}
23+
git push --force --quiet "https://${GITHUB_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${REPO}.git" "master:${INPUT_TARGET_BRANCH}"
2224
rm -rf .git
2325

2426
# Tried https://developer.github.com/v3/repos/pages/#request-a-page-build

0 commit comments

Comments
 (0)