Skip to content

Commit 19caa5c

Browse files
authored
Merge pull request #34 from Woile/master
Make tags optional
2 parents 02b0b75 + 13f1d99 commit 19caa5c

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
| github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. |
4242
| branch | string | 'master' | Destination branch to push changes. |
4343
| force | boolean | false | Determines if force push is used. |
44+
| tags | boolean | false | Determines if `--tags` is used. |
4445
| directory | string | '.' | Directory to change to before pushing. |
4546
| 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. |
4647

‎action.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ inputs:
1919
force:
2020
description: 'Determines if force push is used'
2121
required: false
22+
tags:
23+
description: 'Determines if --tags is used'
24+
required: false
2225
directory:
2326
description: 'Directory to change to before pushing.'
2427
required: false

‎start.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -e
33

44
INPUT_BRANCH=${INPUT_BRANCH:-master}
55
INPUT_FORCE=${INPUT_FORCE:-false}
6+
INPUT_TAGS=${INPUT_TAGS:-false}
67
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
78
_FORCE_OPTION=''
89
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
@@ -17,8 +18,12 @@ if ${INPUT_FORCE}; then
1718
_FORCE_OPTION='--force'
1819
fi
1920

21+
if ${TAGS}; then
22+
_TAGS='--tags'
23+
fi
24+
2025
cd ${INPUT_DIRECTORY}
2126

2227
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
2328

24-
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION;
29+
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;

0 commit comments

Comments
 (0)