Skip to content

Commit f17d07c

Browse files
authored
Add only push tags support (#154)
* feat: Add only push tags support
1 parent 2ebd2b2 commit f17d07c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ jobs:
281281
| force_with_lease | boolean | false | Determines if force-with-lease push is used. Please specify the corresponding branch inside `ref` section of the checkout action e.g. `ref: ${{ github.head_ref }}`. Be aware, if you want to update the branch and the corresponding tag please use the `force` parameter instead of the `force_with_lease` option. |
282282
| atomic | boolean | true | Determines if [atomic](https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic) push is used. |
283283
| push_to_submodules | string | 'on-demand' | Determines if --recurse-submodules=<strategy> is used. The value defines the used strategy. |
284+
| push_only_tags | boolean | false | Determines if the action should only push the tags, default false |
284285
| tags | boolean | false | Determines if `--tags` is used. |
285286
| directory | string | '.' | Directory to change to before pushing. |
286287
| repository | string | '' | Repository name. <br /> Default or empty repository name represents <br /> current github repository. <br /> If you want to push to other repository, <br /> you should make a [personal access token](https://github.com/settings/tokens) <br /> and use it as the `github_token` input. |

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ inputs:
3939
tags:
4040
description: 'Determines if --tags is used'
4141
required: false
42+
push_only_tags:
43+
description: 'Determines if the action should only push the tags, default false'
44+
required: false
4245
directory:
4346
description: 'Directory to change to before pushing.'
4447
required: false

start.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ INPUT_FORCE=${INPUT_FORCE:-false}
66
INPUT_FORCE_WITH_LEASE=${INPUT_FORCE_WITH_LEASE:-false}
77
INPUT_SSH=${INPUT_SSH:-false}
88
INPUT_TAGS=${INPUT_TAGS:-false}
9+
INPUT_PUSH_ONLY_TAGS=${INPUT_PUSH_ONLY_TAGS:-false}
910
INPUT_DIRECTORY=${INPUT_DIRECTORY:-"."}
1011
INPUT_PUSH_TO_SUBMODULES=${INPUT_PUSH_TO_SUBMODULES:-""}
1112
_ATOMIC_OPTION=""
@@ -53,6 +54,8 @@ fi
5354

5455
if ! ${INPUT_FORCE_WITH_LEASE}; then
5556
ADDITIONAL_PARAMETERS="${remote_repo} HEAD:${INPUT_BRANCH}"
57+
elif ${INPUT_PUSH_ONLY_TAGS}; then
58+
ADDITIONAL_PARAMETERS="${remote_repo}"
5659
fi
5760

5861
if ${INPUT_FORCE_WITH_LEASE} && ${INPUT_TAGS}; then

0 commit comments

Comments
 (0)