commit
19caa5c351
@ -41,6 +41,7 @@ jobs:
|
|||||||
| github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. |
|
| github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. |
|
||||||
| branch | string | 'master' | Destination branch to push changes. |
|
| branch | string | 'master' | Destination branch to push changes. |
|
||||||
| force | boolean | false | Determines if force push is used. |
|
| 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. |
|
| 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. |
|
| 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. |
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@ inputs:
|
|||||||
force:
|
force:
|
||||||
description: 'Determines if force push is used'
|
description: 'Determines if force push is used'
|
||||||
required: false
|
required: false
|
||||||
|
tags:
|
||||||
|
description: 'Determines if --tags is used'
|
||||||
|
required: false
|
||||||
directory:
|
directory:
|
||||||
description: 'Directory to change to before pushing.'
|
description: 'Directory to change to before pushing.'
|
||||||
required: false
|
required: false
|
||||||
|
7
start.sh
7
start.sh
@ -3,6 +3,7 @@ set -e
|
|||||||
|
|
||||||
INPUT_BRANCH=${INPUT_BRANCH:-master}
|
INPUT_BRANCH=${INPUT_BRANCH:-master}
|
||||||
INPUT_FORCE=${INPUT_FORCE:-false}
|
INPUT_FORCE=${INPUT_FORCE:-false}
|
||||||
|
INPUT_TAGS=${INPUT_TAGS:-false}
|
||||||
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
|
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
|
||||||
_FORCE_OPTION=''
|
_FORCE_OPTION=''
|
||||||
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
|
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
|
||||||
@ -17,8 +18,12 @@ if ${INPUT_FORCE}; then
|
|||||||
_FORCE_OPTION='--force'
|
_FORCE_OPTION='--force'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ${TAGS}; then
|
||||||
|
_TAGS='--tags'
|
||||||
|
fi
|
||||||
|
|
||||||
cd ${INPUT_DIRECTORY}
|
cd ${INPUT_DIRECTORY}
|
||||||
|
|
||||||
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
|
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user