From dbccd851c4be833237034eac5e42326763cb4770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Fraire=20Willemo=C3=ABs?= Date: Fri, 22 Nov 2019 12:28:11 +0100 Subject: [PATCH 1/3] add tags --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 4462862..9f28daf 100755 --- a/start.sh +++ b/start.sh @@ -21,4 +21,4 @@ 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; From 508672e3d661a58b39143a7b54bea3bddf0f931b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Fraire=20Willemo=C3=ABs?= Date: Fri, 22 Nov 2019 12:30:46 +0100 Subject: [PATCH 2/3] feat: tags is now configurable --- action.yml | 3 +++ start.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e583178..e9cc08b 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,9 @@ inputs: 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 9f28daf..e4a0a3d 100755 --- a/start.sh +++ b/start.sh @@ -3,6 +3,7 @@ set -e 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 @@ if ${INPUT_FORCE}; then _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 --tags; +git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS; From 13f1d99dc9e641fd71788eaf615392329770371b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Fraire=20Willemo=C3=ABs?= Date: Fri, 22 Nov 2019 12:39:09 +0100 Subject: [PATCH 3/3] docs: added information about tags to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d718ded..b0c5c60 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ jobs: | 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. |