Skip to content

Commit 2ebd2b2

Browse files
authored
Issue 191 (#197)
* feat: Adjust the start.sh and add .gitignore * docs: Update the documentation
1 parent 9870d48 commit 2ebd2b2

3 files changed

Lines changed: 27 additions & 22 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea/

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,18 @@ jobs:
272272

273273
### Inputs
274274

275-
| name | value | default | description |
276-
|--------------------|---------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
277-
| github_token | string | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). |
278-
| ssh | boolean | false | Determines if ssh/ Deploy Keys is used. |
279-
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
280-
| force | boolean | false | Determines if force push is used. |
281-
| 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 }}`. |
282-
| atomic | boolean | true | Determines if [atomic](https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic) push is used. |
283-
| push_to_submodules | string | 'on-demand' | Determines if --recurse-submodules=<strategy> is used. The value defines the used strategy. |
284-
| tags | boolean | false | Determines if `--tags` is used. |
285-
| directory | string | '.' | Directory to change to before pushing. |
286-
| 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. |
275+
| name | value | default | description |
276+
|--------------------|---------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
277+
| github_token | string | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). |
278+
| ssh | boolean | false | Determines if ssh/ Deploy Keys is used. |
279+
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
280+
| force | boolean | false | Determines if force push is used. |
281+
| 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. |
282+
| atomic | boolean | true | Determines if [atomic](https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic) push is used. |
283+
| push_to_submodules | string | 'on-demand' | Determines if --recurse-submodules=<strategy> is used. The value defines the used strategy. |
284+
| tags | boolean | false | Determines if `--tags` is used. |
285+
| directory | string | '.' | Directory to change to before pushing. |
286+
| 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. |
287287

288288
## Troubleshooting
289289

start.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ 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_DIRECTORY=${INPUT_DIRECTORY:-'.'}
10-
INPUT_PUSH_TO_SUBMODULES=${INPUT_PUSH_TO_SUBMODULES:-''}
11-
_ATOMIC_OPTION=''
12-
_FORCE_OPTION=''
9+
INPUT_DIRECTORY=${INPUT_DIRECTORY:-"."}
10+
INPUT_PUSH_TO_SUBMODULES=${INPUT_PUSH_TO_SUBMODULES:-""}
11+
_ATOMIC_OPTION=""
12+
_FORCE_OPTION=""
1313
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
1414

1515
echo "Push to branch $INPUT_BRANCH";
1616
[ -z "${INPUT_GITHUB_TOKEN}" ] && {
17-
echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".';
17+
echo "Missing input 'github_token: ${{ secrets.GITHUB_TOKEN }}'.";
1818
exit 1;
1919
};
2020

2121
if ${INPUT_FORCE} && ${INPUT_FORCE_WITH_LEASE}; then
22-
echo 'Please, specify only force or force_with_lease and not both.';
22+
echo "Please, specify only force or force_with_lease and not both.";
2323
exit 1;
2424
fi
2525

2626
if ${INPUT_ATOMIC}; then
27-
_ATOMIC_OPTION='--atomic'
27+
_ATOMIC_OPTION="--atomic"
2828
fi
2929

3030
if ${INPUT_FORCE}; then
31-
_FORCE_OPTION='--force'
31+
_FORCE_OPTION="--force"
3232
fi
3333

3434
if ${INPUT_FORCE_WITH_LEASE}; then
35-
_FORCE_OPTION='--force-with-lease'
35+
_FORCE_OPTION="--force-with-lease"
3636
fi
3737

3838
if ${INPUT_TAGS}; then
39-
_TAGS='--tags'
39+
_TAGS="--tags"
4040
fi
4141

4242
if [ -n "${INPUT_PUSH_TO_SUBMODULES}" ]; then
@@ -55,4 +55,8 @@ if ! ${INPUT_FORCE_WITH_LEASE}; then
5555
ADDITIONAL_PARAMETERS="${remote_repo} HEAD:${INPUT_BRANCH}"
5656
fi
5757

58+
if ${INPUT_FORCE_WITH_LEASE} && ${INPUT_TAGS}; then
59+
_ATOMIC_OPTION=""
60+
fi
61+
5862
git push $ADDITIONAL_PARAMETERS $_INPUT_PUSH_TO_SUBMODULES $_ATOMIC_OPTION --follow-tags $_FORCE_OPTION $_TAGS;

0 commit comments

Comments
 (0)