Merge pull request #7 from anarcher/master
Add INPUT_REPOSITORY for another repository push
diff --git a/README.md b/README.md
index e40e109..e4f29d5 100644
--- a/README.md
+++ b/README.md
@@ -32,10 +32,11 @@
| name | value | default | description |
| ---- | ----- | ------- | ----------- |
-| github_token | string | | Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }}'. |
+| github_token | string | | Token for the repo. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. |
| branch | string | 'master' | Destination branch to push changes. |
| force | boolean | false | Determines if force push is used. |
| directory | string | '.' | Directory to change to before pushing. |
+| repository | string | '' | Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a [personal access token](https://github.com/settings/tokens) and use it as the `github_token` input. |
## License
diff --git a/action.yml b/action.yml
index 09ccdc4..09949aa 100644
--- a/action.yml
+++ b/action.yml
@@ -8,6 +8,10 @@
github_token:
description: 'Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
required: true
+ repository:
+ description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
+ default: ''
+ required: false
branch:
description: 'Destination branch to push changes'
required: false
diff --git a/start.sh b/start.sh
index acc12b3..d2e58db 100755
--- a/start.sh
+++ b/start.sh
@@ -5,6 +5,7 @@
INPUT_FORCE=${INPUT_FORCE:-false}
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
_FORCE_OPTION=''
+REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
echo "Push to branch $INPUT_BRANCH";
[ -z "${INPUT_GITHUB_TOKEN}" ] && {