commit
35284cf030
@ -95,6 +95,7 @@ jobs:
|
|||||||
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
|
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
|
||||||
| force | boolean | false | Determines if force push is used. |
|
| force | boolean | false | Determines if force push is used. |
|
||||||
| 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 }}`. |
|
| 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 }}`. |
|
||||||
|
| atomic | boolean | true | Determines if [atomic](https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic) push is used. |
|
||||||
| tags | boolean | false | Determines if `--tags` 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. <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. |
|
| 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. |
|
||||||
|
@ -29,6 +29,9 @@ inputs:
|
|||||||
force_with_lease:
|
force_with_lease:
|
||||||
description: 'Determines if force-with-lease push is used'
|
description: 'Determines if force-with-lease push is used'
|
||||||
required: false
|
required: false
|
||||||
|
atomic:
|
||||||
|
description: 'Determines if atomic push is used, default true'
|
||||||
|
required: false
|
||||||
tags:
|
tags:
|
||||||
description: 'Determines if --tags is used'
|
description: 'Determines if --tags is used'
|
||||||
required: false
|
required: false
|
||||||
|
10
start.sh
10
start.sh
@ -1,11 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
INPUT_ATOMIC=${INPUT_ATOMIC:-true}
|
||||||
INPUT_FORCE=${INPUT_FORCE:-false}
|
INPUT_FORCE=${INPUT_FORCE:-false}
|
||||||
INPUT_FORCE_WITH_LEASE=${INPUT_FORCE_WITH_LEASE:-false}
|
INPUT_FORCE_WITH_LEASE=${INPUT_FORCE_WITH_LEASE:-false}
|
||||||
INPUT_SSH=${INPUT_SSH:-false}
|
INPUT_SSH=${INPUT_SSH:-false}
|
||||||
INPUT_TAGS=${INPUT_TAGS:-false}
|
INPUT_TAGS=${INPUT_TAGS:-false}
|
||||||
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
|
INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
|
||||||
|
_ATOMIC_OPTION=''
|
||||||
_FORCE_OPTION=''
|
_FORCE_OPTION=''
|
||||||
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
|
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
|
||||||
|
|
||||||
@ -20,6 +22,10 @@ if ${INPUT_FORCE} && ${INPUT_FORCE_WITH_LEASE}; then
|
|||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ${INPUT_ATOMIC}; then
|
||||||
|
_ATOMIC_OPTION='--atomic'
|
||||||
|
fi
|
||||||
|
|
||||||
if ${INPUT_FORCE}; then
|
if ${INPUT_FORCE}; then
|
||||||
_FORCE_OPTION='--force'
|
_FORCE_OPTION='--force'
|
||||||
fi
|
fi
|
||||||
@ -41,7 +47,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ${INPUT_FORCE_WITH_LEASE}; then
|
if ${INPUT_FORCE_WITH_LEASE}; then
|
||||||
git push --follow-tags $_FORCE_OPTION $_TAGS;
|
git push $_ATOMIC_OPTION --follow-tags $_FORCE_OPTION $_TAGS;
|
||||||
else
|
else
|
||||||
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --verbose --follow-tags $_FORCE_OPTION $_TAGS;
|
git push "${remote_repo}" HEAD:${INPUT_BRANCH} $_ATOMIC_OPTION --verbose --follow-tags $_FORCE_OPTION $_TAGS;
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user