1
0
Fork 0
mirror of https://github.com/ad-m/github-push-action.git synced 2025-06-07 22:17:02 +09:00

Add only push tags support (#154)

* feat: Add only push tags support
This commit is contained in:
Pascal Zimmermann 2024-06-27 21:32:06 +02:00 committed by GitHub
parent 2ebd2b29bb
commit f17d07cb45
Signed by: github
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View file

@ -281,6 +281,7 @@ jobs:
| 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. |
| atomic | boolean | true | Determines if [atomic](https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic) push is used. |
| push_to_submodules | string | 'on-demand' | Determines if --recurse-submodules=<strategy> is used. The value defines the used strategy. |
| push_only_tags | boolean | false | Determines if the action should only push the tags, default false |
| tags | boolean | false | Determines if `--tags` is used. |
| directory | string | '.' | Directory to change to before pushing. |
| 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. |

View file

@ -39,6 +39,9 @@ inputs:
tags:
description: 'Determines if --tags is used'
required: false
push_only_tags:
description: 'Determines if the action should only push the tags, default false'
required: false
directory:
description: 'Directory to change to before pushing.'
required: false

View file

@ -6,6 +6,7 @@ INPUT_FORCE=${INPUT_FORCE:-false}
INPUT_FORCE_WITH_LEASE=${INPUT_FORCE_WITH_LEASE:-false}
INPUT_SSH=${INPUT_SSH:-false}
INPUT_TAGS=${INPUT_TAGS:-false}
INPUT_PUSH_ONLY_TAGS=${INPUT_PUSH_ONLY_TAGS:-false}
INPUT_DIRECTORY=${INPUT_DIRECTORY:-"."}
INPUT_PUSH_TO_SUBMODULES=${INPUT_PUSH_TO_SUBMODULES:-""}
_ATOMIC_OPTION=""
@ -53,6 +54,8 @@ fi
if ! ${INPUT_FORCE_WITH_LEASE}; then
ADDITIONAL_PARAMETERS="${remote_repo} HEAD:${INPUT_BRANCH}"
elif ${INPUT_PUSH_ONLY_TAGS}; then
ADDITIONAL_PARAMETERS="${remote_repo}"
fi
if ${INPUT_FORCE_WITH_LEASE} && ${INPUT_TAGS}; then