Compare commits

..

51 Commits

Author SHA1 Message Date
Stefan Zweifel
c180c695f2 Release v4.2.0 2020-05-10 13:16:25 +02:00
Stefan Zweifel
c1a70c9013 Update Changelog 2020-05-10 13:12:24 +02:00
Stefan Zweifel
02c4f2cf78 Merge pull request #73 from spawnia/restructure-readme
Bundle limitations and gotchas together in the README.md
2020-05-10 13:11:32 +02:00
Stefan Zweifel
3c687aa8ba Replace head_ref with branch name example 2020-05-10 13:09:18 +02:00
spawnia
a69eabaead clarify branch option 2020-05-10 12:55:07 +02:00
spawnia
9f2c45c9eb Remove unneeded hints to re-specify the default branch 2020-05-10 12:51:21 +02:00
spawnia
5bf88dc2fd Merge branch 'master' into restructure-readme 2020-05-10 12:48:11 +02:00
Stefan Zweifel
fd2aab7c5b Merge pull request #75 from stefanzweifel/use-head-ref-as-default-value
Use github.head_ref as branch default value
2020-05-10 12:31:26 +02:00
Stefan Zweifel
f342c95aa2 Use github.head_ref as branch default value 2020-05-09 12:44:07 +02:00
Benedikt Franke
1157d7bbe9 Shorten 2020-05-06 00:22:05 +02:00
Benedikt Franke
58b79711d8 Add example 2020-05-06 00:21:35 +02:00
Benedikt Franke
f5f76eb1f4 Consolidate more 2020-05-06 00:00:33 +02:00
Benedikt Franke
5513d18f64 Bundle limitations and gotchas together in the README.md 2020-05-05 23:54:32 +02:00
Stefan Zweifel
6ef5688e81 Update bug_report.md 2020-05-01 12:56:39 +02:00
Stefan Zweifel
e02ededdeb Update README with instructions and limitations
Closes #69
2020-05-01 12:56:23 +02:00
Stefan Zweifel
2f5e73df85 Release v4.1.6 2020-04-28 13:28:19 +02:00
Stefan Zweifel
cc16347545 Merge pull request #68 from stefanzweifel/fix-67
Inline User Configuration when creating a Tag
2020-04-28 13:27:03 +02:00
Stefan Zweifel
1ee136f439 Inline user config with tag command 2020-04-28 13:12:43 +02:00
Stefan Zweifel
7fdc480651 Update README.md 2020-04-24 10:14:37 +02:00
Stefan Zweifel
394681d465 Release v4.1.5 2020-04-23 20:46:50 +02:00
Stefan Zweifel
a261484cc8 Update file_pattern Example in README 2020-04-23 20:46:41 +02:00
Stefan Zweifel
43ed630979 Merge pull request #64 from stefanzweifel/fix-61
Fix Issue with Commit Options
2020-04-23 20:35:56 +02:00
Stefan Zweifel
ee9d717e46 Merge branch 'master' into fix-61
# Conflicts:
#	entrypoint.sh
2020-04-23 20:20:10 +02:00
Stefan Zweifel
68b94ecdf3 Merge pull request #65 from cristianpb/master
 Allow to add multiple files
2020-04-23 16:20:11 +02:00
cristianpb
2b0a9bca02 Allow to add multiple files 2020-04-23 15:55:10 +02:00
Stefan Zweifel
13c9c82cae Merge pull request #63 from stefanzweifel/revert-62-revert-59-no-override-global-git
Revert "Revert "Place git user configuration inline before commit""
2020-04-22 21:20:00 +02:00
Stefan Zweifel
6e0a745133 Use Array 2020-04-22 21:17:10 +02:00
Stefan Zweifel
88ddd5fba5 WIP 2020-04-22 21:04:17 +02:00
Stefan Zweifel
2dec151b5c WIP 2020-04-22 20:49:36 +02:00
Stefan Zweifel
1ba0b8765f WIP 2020-04-22 20:43:52 +02:00
Stefan Zweifel
f278d451d8 Revert hard coded options 2020-04-22 20:39:17 +02:00
Stefan Zweifel
1f6bf5e4c0 Set default value for commit_options 2020-04-22 20:39:08 +02:00
Stefan Zweifel
5dae7dbdb7 Hard Code Options 2020-04-22 20:36:26 +02:00
Stefan Zweifel
fbbf9665a8 Output git version and debugging message 2020-04-22 20:21:08 +02:00
Stefan Zweifel
e8ab63a01b Add ; in more places 2020-04-22 20:17:05 +02:00
Stefan Zweifel
fdbf836519 Split git-commit command 2020-04-22 20:07:31 +02:00
Stefan Zweifel
8f94f9b7ec Revert "Revert "Place git user configuration inline before commit"" 2020-04-22 20:04:52 +02:00
Stefan Zweifel
e6db1ef8bd Release v4.1.4 2020-04-22 12:58:51 +02:00
Stefan Zweifel
d09082150e Merge pull request #62 from stefanzweifel/revert-59-no-override-global-git
Revert "Place git user configuration inline before commit"
2020-04-22 12:56:36 +02:00
Stefan Zweifel
3e578b5696 Revert "Place git user configuration inline before commit" 2020-04-22 12:55:25 +02:00
Stefan Zweifel
c586963a3d Update README 2020-04-18 10:55:30 +02:00
Stefan Zweifel
a7342eab13 Release v4.1.3 2020-04-18 10:55:26 +02:00
Stefan Zweifel
256f31683d Add some Debug Logs 2020-04-18 10:53:20 +02:00
Stefan Zweifel
8040ba33d6 Merge pull request #59 from parndt/no-override-global-git
Place git user configuration inline before commit
2020-04-10 14:50:57 +02:00
Philip Arndt
80c7ed953f Place git user configuration inline 2020-04-10 11:38:03 +12:00
Stefan Zweifel
dd055f6225 Release v4.1.2 2020-04-03 09:19:39 +02:00
Stefan Zweifel
55734408b7 Merge pull request #57 from wxt2005/master
Remove unnecessary escape
2020-04-03 09:10:34 +02:00
Botao
d317154f77 Remove unnecessary escape 2020-04-03 13:21:53 +08:00
Stefan Zweifel
36489f4cb5 Merge pull request #56 from localheinz/patch-1
Fix: Typo
2020-03-17 15:44:10 +01:00
Andreas Möller
2530046e72 Fix: Typo 2020-03-17 13:44:47 +01:00
Stefan Zweifel
172c2a2fc3 Update CD Workflow 2020-03-14 13:39:33 +01:00
6 changed files with 145 additions and 108 deletions

View File

@@ -7,8 +7,10 @@ assignees: ''
--- ---
<!-- Before opening an issue, have you tried solving your problem by explicitly setting the `branch`-value in your workflow? -->
**Version of the Action** **Version of the Action**
`v2.x.x` `v4.x.x`
**Describe the bug** **Describe the bug**
A clear and concise description of what the bug is. A clear and concise description of what the bug is.
@@ -26,5 +28,11 @@ A clear and concise description of what you expected to happen.
**Screenshots** **Screenshots**
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
**Used Workflow**
```yaml
# Paste the Workflow you've used here
```
**Additional context** **Additional context**
Add any other context about the problem here. Add any other context about the problem here.

View File

@@ -25,5 +25,7 @@ jobs:
with: with:
draft: false draft: false
prerelease: false prerelease: false
body: |
See [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) for details.
release_name: "${{ steps.determine-tag.outputs.tag }}" release_name: "${{ steps.determine-tag.outputs.tag }}"
tag_name: "${{ steps.determine-tag.outputs.tag }}" tag_name: "${{ steps.determine-tag.outputs.tag }}"

View File

@@ -4,9 +4,50 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.1...HEAD) ## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.2.0...HEAD)
## [v4.1.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.1...v4.1.1) - 2020-03-14 > TBD
## [v4.2.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.6...v4.2.0) - 2020-05-10
### Changed
- Use `${{ github.head_ref }}` as default branch value. Therefore, the branch name when listening for `pull_request`-events is optional. [#75](https://github.com/stefanzweifel/git-auto-commit-action/pull/75), [#73](https://github.com/stefanzweifel/git-auto-commit-action/pull/73)
## [v4.1.6](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.5...v4.1.6) - 2020-04-28
### Fixes
- Fix issue where tags could not be created correctly [#68](https://github.com/stefanzweifel/git-auto-commit-action/pull/68)
## [v4.1.5](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.4...v4.1.5) - 2020-04-23
### Added
- Update `file_pattern` to support multiple file paths [#65](https://github.com/stefanzweifel/git-auto-commit-action/pull/65)
### Changes
- Revert changes made in v4.1.4 [#63](https://github.com/stefanzweifel/git-auto-commit-action/pull/63)
### Fixes
- Fix issue with `commit_options` [#64](https://github.com/stefanzweifel/git-auto-commit-action/pull/64)
## [v4.1.4](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.3...v4.1.4) - 2020-04-22
### Fixed
- Fix bug introduced in previous version, where git user configuration has been placed inline [#62](https://github.com/stefanzweifel/git-auto-commit-action/pull/62)
## [v4.1.3](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.2...v4.1.3) - 2020-04-18
### Changed
- Place Git user configuration inline [#59](https://github.com/stefanzweifel/git-auto-commit-action/pull/59)
## [v4.1.2](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.1...v4.1.2) - 2020-04-03
### Fixes
- Fix Issue with `changes_detected`-output [#57](https://github.com/stefanzweifel/git-auto-commit-action/pull/57)
## [v4.1.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.0...v4.1.1) - 2020-03-14
### Fixes ### Fixes
- Fix issue where commit has not been pushed to remote repository, when no `branch`-option has been given [#54](https://github.com/stefanzweifel/git-auto-commit-action/pull/54) - Fix issue where commit has not been pushed to remote repository, when no `branch`-option has been given [#54](https://github.com/stefanzweifel/git-auto-commit-action/pull/54)

142
README.md
View File

@@ -1,35 +1,31 @@
# git-auto-commit-action # git-auto-commit Action
> The GitHub Action for committing files for the 80% use case.
This GitHub Action automatically commits files which have been changed during a Workflow run and pushes the commit back to GitHub. This GitHub Action automatically commits files which have been changed during a Workflow run and pushes the commit back to GitHub.
The default committer is "GitHub Actions <actions@github.com>" and the default author of the commit is "Your GitHub Username <github_username@users.noreply.github.com>". The default committer is "GitHub Actions <actions@github.com>", and the default author of the commit is "Your GitHub Username <github_username@users.noreply.github.com>".
If no changes are detected, the Action does nothing.
This Action has been inspired and adapted from the [auto-commit](https://github.com/cds-snc/github-actions/tree/master/auto-commit This Action has been inspired and adapted from the [auto-commit](https://github.com/cds-snc/github-actions/tree/master/auto-commit
)-Action of the Canadian Digital Service and this [commit](https://github.com/elstudio/actions-js-build/blob/41d604d6e73d632e22eac40df8cc69b5added04b/commit/entrypoint.sh)-Action by Eric Johnson. )-Action of the Canadian Digital Service and this [commit](https://github.com/elstudio/actions-js-build/blob/41d604d6e73d632e22eac40df8cc69b5added04b/commit/entrypoint.sh)-Action by Eric Johnson.
*This Action currently can't be used in conjunction with pull requests of forks. See [issue #25](https://github.com/stefanzweifel/git-auto-commit-action/issues/25) for more information.*
## Usage ## Usage
**Note:** This Action requires that you use `action/checkout@v2` or above to checkout your repository. Add the following step at the end of your job, after other steps that might add or change files.
Add the following step at the end of your job.
```yaml ```yaml
- uses: stefanzweifel/git-auto-commit-action@v4.1.1 - uses: stefanzweifel/git-auto-commit-action@v4.2.0
with: with:
# Required
commit_message: Apply automatic changes commit_message: Apply automatic changes
# Optional name of the branch the commit should be pushed to # Optional branch to push to, defaults to the current branch
# Required if Action is used in Workflow listening to the `pull_request` event branch: feature-123
branch: ${{ github.head_ref }}
# Optional git params # Optional git params
commit_options: '--no-verify --signoff' commit_options: '--no-verify --signoff'
# Optional glob pattern of files which should be added to the commit # Optional glob pattern of files which should be added to the commit
file_pattern: src/\*.js file_pattern: src/*.js tests/*.js
# Optional local file path to the repository # Optional local file path to the repository
repository: . repository: .
@@ -39,28 +35,26 @@ Add the following step at the end of your job.
commit_user_email: my-github-actions-bot@example.org commit_user_email: my-github-actions-bot@example.org
commit_author: Author <actions@github.com> commit_author: Author <actions@github.com>
# Optional tag message. Will create and push a new tag to the remote repository # Optional tag message
# Action will create and push a new tag to the remote repository and the defined branch
tagging_message: 'v1.0.0' tagging_message: 'v1.0.0'
``` ```
The Action will only commit files back, if changes are available. The resulting commit **will not trigger** another GitHub Actions Workflow run! ## Example
We recommend to use this Action in Workflows, which listen to the `pull_request` event. You can then use the option `branch: ${{ github.head_ref }}` to set up the branch name correctly. In this example, we're running `php-cs-fixer` in a PHP project to fix the codestyle automatically, then commit possible changed files back to the repository.
If you don't pass a branch name, the Action will try to push the commit to a branch with the same name, as with which the repo has been checked out.
## Example Usage Note that we explicitly specify `${{ github.head_ref }}` in the checkout Action.
This is required in order to work with the `pull_request` event (or any other non-`push` event).
This Action will only work, if the job in your Workflow changes files.
The most common use case for this, is when you're running a Linter or Code-Style fixer on GitHub Actions.
In this example I'm running `php-cs-fixer` in a PHP project.
### Example on `pull_request` event
```yaml ```yaml
name: php-cs-fixer name: php-cs-fixer
on: pull_request on:
pull_request:
push:
branches:
- "master"
jobs: jobs:
php-cs-fixer: php-cs-fixer:
@@ -74,85 +68,73 @@ jobs:
- name: Run php-cs-fixer - name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga uses: docker://oskarstark/php-cs-fixer-ga
- uses: stefanzweifel/git-auto-commit-action@v4.1.1 - uses: stefanzweifel/git-auto-commit-action@v4.2.0
with: with:
commit_message: Apply php-cs-fixer changes commit_message: Apply php-cs-fixer changes
branch: ${{ github.head_ref }}
``` ```
### Example on `push` event ## Limitations & Gotchas
### Checkout the correct branch
You must use `action/checkout@v2` or later versions to checkout the repository.
In non-`push` events, such as `pull_request`, make sure to specify the `ref` to checkout:
```yaml ```yaml
name: php-cs-fixer
on: push
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga
- uses: stefanzweifel/git-auto-commit-action@v4.1.1
with: with:
commit_message: Apply php-cs-fixer changes ref: ${{ github.head_ref }}
``` ```
### Inputs You have to do this do avoid that the `checkout`-Action clones your repository in a detached state.
### Commits of this Action do not trigger new Workflow runs
The resulting commit **will not trigger** another GitHub Actions Workflow run.
This is due to [limititations set by GitHub](https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
> When you use the repository's GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs.
You can change this by creating a new [Personal Access Token (PAT)](https://github.com/settings/tokens/new),
storing the token as a secret in your repository and then passing the new token to the [`actions/checkout`](https://github.com/actions/checkout#usage) Action.
```yaml
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
```
### Unable to commit into PRs from forks
GitHub currently prohibits Actions to push commits to forks, even when they created a PR and allow edits.
See [issue #25](https://github.com/stefanzweifel/git-auto-commit-action/issues/25) for more information.
## Inputs
Checkout [`action.yml`](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/action.yml) for a full list of supported inputs. Checkout [`action.yml`](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/action.yml) for a full list of supported inputs.
## Outputs ## Outputs
You can use these outputs to trigger other Actions in your Workflow run based on the result of `git-auto-commit-action`. You can use these outputs to trigger other Actions in your Workflow run based on the result of `git-auto-commit-action`.
- `changes_detected`: Returns either "true" or "false" if the repository was dirty and files have changed. - `changes_detected`: Returns either "true" or "false" if the repository was dirty and files have changed.
## Troubleshooting ## Troubleshooting
### Can't push commit to repository ### Action does not push commit to repository
If your Workflow can't push the commit to the repository because of authentication issues, please update your Workflow configuration and usage of [`actions/checkout`](https://github.com/actions/checkout#usage). (Updating the `token` value with a Personal Access Token should fix your issues)
### Commit of this Action does not trigger a new Workflow run Make sure to [checkout the correct branch](#checkout-the-correct-branch).
As mentioned in the [Usage](#Usage) section, the commit created by this Action **will not trigger** a new Workflow run automatically.
This is due to limitations set up by GitHub: ### Action does not push commit to repository: Authentication Issue
> An action in a workflow run can't trigger a new workflow run. For example, if an action pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur. If your Workflow can't push the commit to the repository because of authentication issues,
[Source](https://help.github.com/en/actions/reference/events-that-trigger-workflows) please update your Workflow configuration and usage of [`actions/checkout`](https://github.com/actions/checkout#usage).
You can change this by creating a new [Pesonal Access Token (PAT)](https://github.com/settings/tokens/new), storing the token as a secret in your repository and then passing the new token to the [`actions/checkout`](https://github.com/actions/checkout#usage) Action. Updating the `token` value with a Personal Access Token should fix your issues.
#### Example Workflow ### No new workflows are triggered by the commit of this action
```yaml This is due to limitations set up by GitHub, [commits of this Action do not trigger new Workflow runs](#commits-of-this-action-do-not-trigger-new-workflow-runs).
name: php-cs-fixer
on: push
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga
- uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: Apply php-cs-fixer changes
```
## Known Issues
- GitHub currently prohibits Actions like this to push changes from a fork to the upstream repository. See [issue #25](https://github.com/stefanzweifel/git-auto-commit-action/issues/25) for more information.
## Versioning ## Versioning

View File

@@ -10,10 +10,11 @@ inputs:
branch: branch:
description: Git branch name, where changes should be pushed too. Required if Action is used on the `pull_request` event description: Git branch name, where changes should be pushed too. Required if Action is used on the `pull_request` event
required: false required: false
default: '' default: ${{ github.head_ref }}
commit_options: commit_options:
description: Commit options (eg. --no-verify) description: Commit options (eg. --no-verify)
required: false required: false
default: ''
file_pattern: file_pattern:
description: File pattern used for `git add`. For example `src/\*.js` description: File pattern used for `git add`. For example `src/\*.js`
required: false required: false

View File

@@ -7,9 +7,7 @@ _main() {
if _git_is_dirty; then if _git_is_dirty; then
echo \"::set-output name=changes_detected::true\" echo "::set-output name=changes_detected::true";
_setup_git
_switch_to_branch _switch_to_branch
@@ -22,43 +20,44 @@ _main() {
_push_to_github _push_to_github
else else
echo \"::set-output name=changes_detected::false\" echo "::set-output name=changes_detected::false";
echo "Working tree clean. Nothing to commit." echo "Working tree clean. Nothing to commit.";
fi fi
} }
_switch_to_repository() { _switch_to_repository() {
echo "INPUT_REPOSITORY value: $INPUT_REPOSITORY"; echo "INPUT_REPOSITORY value: $INPUT_REPOSITORY";
cd $INPUT_REPOSITORY cd $INPUT_REPOSITORY;
} }
_git_is_dirty() { _git_is_dirty() {
[ -n "$(git status -s)" ] [ -n "$(git status -s)" ]
} }
# Set up git user configuration
_setup_git ( ) {
git config --global user.name "$INPUT_COMMIT_USER_NAME"
git config --global user.email "$INPUT_COMMIT_USER_EMAIL"
}
_switch_to_branch() { _switch_to_branch() {
echo "INPUT_BRANCH value: $INPUT_BRANCH"; echo "INPUT_BRANCH value: $INPUT_BRANCH";
# Switch to branch from current Workflow run # Switch to branch from current Workflow run
git checkout $INPUT_BRANCH git checkout $INPUT_BRANCH;
} }
_add_files() { _add_files() {
echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}" echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}";
git add "${INPUT_FILE_PATTERN}" git add ${INPUT_FILE_PATTERN};
} }
_local_commit() { _local_commit() {
echo "INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS}" echo "INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS}";
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$INPUT_COMMIT_AUTHOR" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} echo "::debug::Apply commit options ${INPUT_COMMIT_OPTIONS}";
INPUT_COMMIT_OPTIONS_ARRAY=( $INPUT_COMMIT_OPTIONS );
git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" \
commit -m "$INPUT_COMMIT_MESSAGE" \
--author="$INPUT_COMMIT_AUTHOR" \
${INPUT_COMMIT_OPTIONS:+"${INPUT_COMMIT_OPTIONS_ARRAY[@]}"};
} }
_tag_commit() { _tag_commit() {
@@ -66,9 +65,10 @@ _tag_commit() {
if [ -n "$INPUT_TAGGING_MESSAGE" ] if [ -n "$INPUT_TAGGING_MESSAGE" ]
then then
git tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE" echo "::debug::Create tag $INPUT_TAGGING_MESSAGE";
git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE";
else else
echo " No tagging message supplied. No tag will be added." echo " No tagging message supplied. No tag will be added.";
fi fi
} }
@@ -78,13 +78,16 @@ _push_to_github() {
# Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set # Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set
if [ -n "$INPUT_TAGGING_MESSAGE" ] if [ -n "$INPUT_TAGGING_MESSAGE" ]
then then
git push origin --tags echo "::debug::git push origin --tags";
git push origin --tags;
else else
git push origin echo "::debug::git push origin";
git push origin;
fi fi
else else
git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags echo "::debug::Push commit to remote branch $INPUT_BRANCH";
git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags;
fi fi
} }