Merge pull request #34 from Woile/master
Make tags optional
diff --git a/README.md b/README.md
index d718ded..b0c5c60 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,7 @@
| 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. |
+| tags | boolean | false | Determines if `--tags` 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. |
diff --git a/action.yml b/action.yml
index e583178..e9cc08b 100644
--- a/action.yml
+++ b/action.yml
@@ -19,6 +19,9 @@
force:
description: 'Determines if force push is used'
required: false
+ tags:
+ description: 'Determines if --tags is used'
+ required: false
directory:
description: 'Directory to change to before pushing.'
required: false
diff --git a/start.sh b/start.sh
index 4462862..e4a0a3d 100755
--- a/start.sh
+++ b/start.sh
@@ -3,6 +3,7 @@
INPUT_BRANCH=${INPUT_BRANCH:-master}
INPUT_FORCE=${INPUT_FORCE:-false}
+INPUT_TAGS=${INPUT_TAGS:-false}
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
_FORCE_OPTION=''
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
@@ -17,8 +18,12 @@
_FORCE_OPTION='--force'
fi
+if ${TAGS}; then
+ _TAGS='--tags'
+fi
+
cd ${INPUT_DIRECTORY}
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
-git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION;
+git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;