Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: commitizen-tools/commitizen-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.16.0
Choose a base ref
...
head repository: commitizen-tools/commitizen-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 5, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3d7526e View commit details
  2. Copy the full SHA
    7bf9d14 View commit details

Commits on Feb 6, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    364839d View commit details
  2. Copy the full SHA
    d2a8b02 View commit details

Commits on Feb 9, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    86d2b10 View commit details
  2. Copy the full SHA
    95c0820 View commit details

Commits on Mar 3, 2023

  1. docs(README): add missing inputs (#63)

    Closes #45
    woile authored Mar 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e65baf0 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf3adea View commit details
  3. Copy the full SHA
    b25384c View commit details
  4. fix: add openssh to Dockerfile

    woile committed Mar 3, 2023
    Copy the full SHA
    4629922 View commit details
  5. Copy the full SHA
    cd3c00a View commit details
  6. fix: remove use_ssh flag (#65)

    BREAKING CHANGE: Remove `use_ssh`. Documentation is in place to deploy using SSH keys
    woile authored Mar 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9a52065 View commit details
  7. Copy the full SHA
    50fc9d7 View commit details

Commits on Mar 28, 2023

  1. fix: Add support for GitHub Enterprise Server (#66)

    * fix: Add support for GitHub Enterprise Server based on PR #52 by a-bertroud
    
    * fix: Remove extra line break
    
    ---------
    
    Co-authored-by: Gary <thomas.mackg@gmail.com>
    phoenix1480 and apollosfire authored Mar 28, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    468582c View commit details
  2. Copy the full SHA
    e41bf7f View commit details

Commits on May 18, 2023

  1. fix: install git-lfs into the dockerfile

    mmatl authored and woile committed May 18, 2023
    Copy the full SHA
    f8f96fa View commit details
  2. Copy the full SHA
    4498afe View commit details

Commits on Aug 1, 2023

  1. Copy the full SHA
    0457216 View commit details

Commits on Sep 8, 2023

  1. build: bump python version to 3.10

    BREAKING CHANGE:
    woile committed Sep 8, 2023
    Copy the full SHA
    9f89fad View commit details
  2. Merge pull request #74 from commitizen-tools/fix/bump-py310

    build: bump python version to 3.10
    woile authored Sep 8, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    05779a0 View commit details
  3. Copy the full SHA
    bb0ac7b View commit details

Commits on Sep 14, 2023

  1. Merge pull request #73 from audricschiltknecht/feat/git-to-stderr

    feat: Add new option to hide git output
    woile authored Sep 14, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    61fcde3 View commit details
  2. Copy the full SHA
    bc2616f View commit details

Commits on Jan 26, 2024

  1. Copy the full SHA
    5e30df8 View commit details

Commits on Mar 5, 2024

  1. Merge pull request #79 from janw/add-previous-rev-to-env

    feat: Add PREVIOUS_REVISION to environment
    woile authored Mar 5, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5329248 View commit details
  2. feat: add local version and devrelease as inputs (#69)

    * add local version and devrelease as inputs
    
    * explicitly check for true in local_version check
    karthick-sh authored Mar 5, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    475ad58 View commit details
  3. Copy the full SHA
    1f11eb2 View commit details

Commits on Nov 5, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    arman1371 Reza (Arman) Yazdani
    Copy the full SHA
    7435c66 View commit details
  2. docs(README): add working_directory input

    arman1371 committed Nov 5, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    arman1371 Reza (Arman) Yazdani
    Copy the full SHA
    ee70294 View commit details

Commits on Nov 6, 2024

  1. Merge pull request #90 from arman1371/feat/add-working-directory

    feat: add `working_directory` input
    woile authored Nov 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    23bc292 View commit details
  2. Copy the full SHA
    ee36ca9 View commit details

Commits on Nov 7, 2024

  1. Update entrypoint.sh make check_consistency need to be "true"

    timothyjlaurent authored Nov 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b01f7d6 View commit details
  2. Merge pull request #92 from timothyjlaurent/patch-1

    Fixes #91 Update entrypoint.sh make check_consistency need to be "true"
    woile authored Nov 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    899b309 View commit details

Commits on Dec 9, 2024

  1. Copy the full SHA
    abecbc8 View commit details
  2. Merge pull request #95 from fritz-trawa/55-actor-of-pushing-to-branch…

    …-should-be-configurable
    
    feat(#55): add ACTOR input parameter
    woile authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2294890 View commit details
  3. Copy the full SHA
    673655a View commit details

Commits on Dec 20, 2024

  1. Update entrypoint.sh

    plockaby authored Dec 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1dcad82 View commit details

Commits on Dec 21, 2024

  1. Merge pull request #97 from plockaby/patch-1

    fix: local_version flag is incorrect
    woile authored Dec 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    721fe06 View commit details
  2. Copy the full SHA
    a49cac8 View commit details

Commits on Feb 5, 2025

  1. ci: publish major and minor tags

    Make sure major and minor tags are up to date on a patch release.
    
    This would allow the common practice to use major tag on the action:
    
    ```yaml
    - name: Create bump and changelog
      uses: commitizen-tools/commitizen-action@0
    ```
    
    (Ideally you may want to prefix version with `v` 🤷)
    
    This what this third party action does under the hood:
    
    ```bash
    $ TAG="0.21.0"
    $ MINOR="${TAG%.*}"
    $ echo $MINOR
    0.21
    $ MAJOR="${MINOR%.*}"
    $ echo $MAJOR
    0
    ```
    
    This is used here for example: https://github.com/astral-sh/setup-uv/blob/main/.github/workflows/update-major-minor-tags.yml
    nikaro committed Feb 5, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    nikaro Nicolas Karolak
    Copy the full SHA
    0121edc View commit details
  2. Merge pull request #88 from nikaro/ci/publish-major-minor-tag

    ci: publish major and minor tags
    woile authored Feb 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5bf62b0 View commit details

Commits on Feb 17, 2025

  1. feat: add support for manual version bumping

    ckagerer committed Feb 17, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    ckagerer Christian Kagerer
    Copy the full SHA
    e9a82c8 View commit details

Commits on Feb 23, 2025

  1. ci: trigger build

    ckagerer committed Feb 23, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    ckagerer Christian Kagerer
    Copy the full SHA
    863a354 View commit details

Commits on Feb 25, 2025

  1. Merge pull request #99 from ckagerer/feature/support-for-manual-version

    feat: add support for manual version bumping
    Lee-W authored Feb 25, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4787c27 View commit details
  2. Copy the full SHA
    5b0848c View commit details
Showing with 282 additions and 42 deletions.
  1. +1 −1 .cz.toml
  2. +2 −2 .github/workflows/bumpversion.yaml
  3. +19 −0 .github/workflows/update_semver.yml
  4. +87 −0 CHANGELOG.md
  5. +12 −1 Dockerfile
  6. +80 −6 README.md
  7. +47 −27 action.yml
  8. +34 −5 entrypoint.sh
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.16.0"
version = "0.24.0"
format = "v$version"
update_changelog_on_bump = true
major_version_zero = true
4 changes: 2 additions & 2 deletions .github/workflows/bumpversion.yaml
Original file line number Diff line number Diff line change
@@ -17,12 +17,12 @@ jobs:
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
github_token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
changelog_increment_filename: body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: "body.md"
tag_name: "${{ env.REVISION }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
19 changes: 19 additions & 0 deletions .github/workflows/update_semver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Update Major Minor Tags

on:
push:
branches-ignore:
- "**"
tags:
- "*.*.*"
workflow_dispatch:

jobs:
update_major_minor_tags:
name: Make sure major and minor tags are up to date on a patch release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Update semver
uses: haya14busa/action-update-semver@v1
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
## 0.24.0 (2025-02-25)

### Feat

- add support for manual version bumping

## 0.23.1 (2024-12-21)

## 0.23.0 (2024-12-09)

### Feat

- **#55**: add ACTOR input parameter

## 0.22.0 (2024-11-06)

### Feat

- add working-directory input

## 0.21.0 (2024-03-05)

### Feat

- add local version and devrelease as inputs (#69)
- Add PREVIOUS_REVISION to environment

## 0.20.0 (2023-09-14)

### Feat

- Add new option to hide git output

## 0.19.0 (2023-09-08)

## 0.18.2 (2023-05-18)

### Fix

- install git-lfs into the dockerfile

## 0.18.1 (2023-03-28)

### Fix

- Add support for GitHub Enterprise Server (#66)

## 0.18.0 (2023-03-03)

### BREAKING CHANGE

- Remove `use_ssh`. Documentation is in place to deploy using SSH keys

### Fix

- remove use_ssh flag (#65)

## 0.17.1 (2023-03-03)

### Fix

- add openssh to Dockerfile

## 0.17.0 (2023-03-03)

### Feat

- add support for SSH deploy keys (#64)

## 0.16.3 (2023-02-09)

### Fix

- missing `libffi-dev` in `Dockerfile` which breaks third party plugins (#60)

## 0.16.2 (2023-02-06)

### Fix

- change docker image version back to 3.8 (#59)

## 0.16.1 (2023-02-05)

### Fix

- add safe directory to git (#57)

## 0.16.0 (2023-01-07)

### Feat
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
FROM python:3.8
FROM python:3.10-alpine

RUN set -eux; \
apk add --no-cache \
git \
git-lfs \
gpg \
alpine-sdk \
bash \
libffi-dev \
; \
git lfs install;
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
86 changes: 80 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ jobs:
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
@@ -66,13 +66,15 @@ jobs:
| Name | Description | Default |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - |
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. Required if `push: true` | - |
| `working_directory` | Change to this directory before running | repo root directory |
| `dry_run` | Run without creating commit, output to stdout | false |
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
| `branch` | Destination branch to push changes | Same as the one executing the action by default |
| `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - |
| `extra_requirements` | Custom requirements, if your project uses a custom rule or plugins, you can specify them separated by a space. E.g: `'commitizen-emoji conventional-JIRA'` | - |
| `changelog_increment_filename` | Filename to store the incremented generated changelog. This is different to changelog as it only contains the changes for the just generated version. Example: `body.md` | - |
| `git_redirect_stderr` | Redirect git output to stderr. Useful if you do not want git output in your changelog | `false` |
| `git_name` | Name used to configure git (for git operations) | `github-actions[bot]` |
| `git_email` | Email address used to configure git (for git operations) | `github-actions[bot]@users.noreply.github.com` |
| `push` | Define if the changes should be pushed to the branch. | true |
@@ -81,15 +83,87 @@ jobs:
| `commitizen_version` | Specify the version to be used by commitizen. Eg: `2.21. | latest |
| `changelog` | Create changelog when bumping the version | true |
| `no_raise` | Don't raise the given comma-delimited exit codes (e.g., no_raise: '20,21'). Use with caution! Open an issue in [commitizen](https://github.com/commitizen-tools/commitizen/issues) if you need help thinking about your workflow. | [21](https://commitizen-tools.github.io/commitizen/exit_codes/) |
| `increment` | Manually specify the desired increment {MAJOR,MINOR,PATCH} | - |
| `increment` | Manually specify the desired increment {MAJOR,MINOR, PATCH} | - |
| `check_consistency` | Check consistency among versions defined in commitizen configuration and version_files | `false` |
| `gpg_sign` | If true, use GPG to sign commits and tags (for git operations). Requires separate setup of GPG key and passphrase in GitHub Actions (e.g. with the action `crazy-max/ghaction-import-gpg`) | `false` |
| `debug` | Prints debug output to GitHub Actions stdout | `false` |

## Outputs

| Name | Description |
|-----------|-----------------|
| --------- | --------------- |
| `version` | The new version |

Additionally, the new version is also available as an environment variable under `REVISION`.
The new version is also available as an environment variable under `REVISION` or you can access using `${{ steps.cz.outputs.version }}`

## Using SSH with deploy keys

1. Create a [deploy key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#deploy-keys) (which is the SSH **public key**)
2. Add the **private key** as a [Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) in your repository, e.g: `COMMIT_KEY`
3. Set up your action

```yaml
name: Bump version
on:
push:
branches:
- main
jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
push: false
- name: Push using ssh
run: |
git push origin main --tags
```

## Creating a Github release

```yaml
name: Bump version
on:
push:
branches:
- main
jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
changelog_increment_filename: body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: "body.md"
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

## Troubleshooting

@@ -100,7 +174,7 @@ actions [by design][by_design].

To solve it, you must use a personal access token in the checkout and the commitizen steps.

Follow the instructions in [commitizen's documentation][cz-docs-ga]
Follow the instructions in [commitizen's documentation][cz-docs-ga].

## I'm not using conventional commits, I'm using my own set of rules on commits

74 changes: 47 additions & 27 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: 'Bump and changelog using commitizen'
description: 'Create a commit bumping the version of your project and creating a changelog file'
name: "Bump and changelog using commitizen"
description: "Create a commit bumping the version of your project and creating a changelog file"
runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"
branding:
icon: 'git-commit'
color: 'purple'
icon: "git-commit"
color: "purple"
outputs:
version:
description: 'New version'
description: "New version"
inputs:
working_directory:
description: "Change to this directory before running"
required: false
dry_run:
description: 'Run without creating commit, output to stdout'
description: "Run without creating commit, output to stdout"
required: false
commit:
description: 'If true a commit is created containing the bump changes'
description: "If true a commit is created containing the bump changes"
required: false
default: "true"
push:
description: 'If true the bump commit is pushed to the remote repository'
description: "If true the bump commit is pushed to the remote repository"
required: false
default: "true"
merge:
@@ -28,51 +31,62 @@ inputs:
required: false
default: "false"
prerelease:
description: 'Set as prerelease version'
description: "Set as prerelease version"
required: false
devrelease:
description: "Non-negative integer for dev. release"
required: false
local_version:
description: "Bump only the local version portion"
required: false
default: "false"
changelog:
description: 'Create changelog when bumping the version'
description: "Create changelog when bumping the version"
default: "true"
required: false
github_token:
description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}'
required: true
required: false
repository:
description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
default: ''
description: "Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})"
default: ""
required: false
branch:
description: 'Destination branch to push changes'
description: "Destination branch to push changes"
required: false
default: ''
default: ""
extra_requirements:
description: 'Extra commitizen dependencies like your custom plugins or rules'
description: "Extra commitizen dependencies like your custom plugins or rules"
required: false
default: ''
default: ""
changelog_increment_filename:
description: 'Filename to store the incremented generated changelog. This is different to changelog as it only contains the changes for the just generated version'
description: "Filename to store the incremented generated changelog. This is different to changelog as it only contains the changes for the just generated version"
required: false
git_redirect_stderr:
description: "Redirect git output to stderr. Useful if you do not want git output in your changelog"
required: false
default: "false"
git_name:
description: 'Name used to configure git (for git operations)'
description: "Name used to configure git (for git operations)"
required: false
default: 'github-actions[bot]'
default: "github-actions[bot]"
git_email:
description: 'Email address used to configure git (for git operations)'
description: "Email address used to configure git (for git operations)"
required: false
default: 'github-actions[bot]@users.noreply.github.com'
default: "github-actions[bot]@users.noreply.github.com"
commitizen_version:
description: 'Specify the version to be used by commitizen'
description: "Specify the version to be used by commitizen"
required: false
default: latest
no_raise:
description: "Don't raise the given comma-delimited exit codes"
required: false
default: '21'
default: "21"
increment:
description: "Manually specify the desired increment"
required: false
check_consistency:
default: 'false'
default: "false"
description: "check consistency among versions defined in commitizen configuration and version_files"
required: false
gpg_sign:
@@ -86,3 +100,9 @@ inputs:
description: "If true, prints debug output to GitHub Actions stdout."
required: false
default: "false"
actor:
description: "The account that will be used to perform git operations, defaults to the GITHUB_ACTOR"
required: false
manual_version:
description: "Manually specify the version to bump to"
required: false
39 changes: 34 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -2,14 +2,20 @@

set -e

# Reporting
gpg --version
git --version

if [[ -z $INPUT_GITHUB_TOKEN ]]; then
echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".' >&2
if [[ -z $INPUT_GITHUB_TOKEN && $INPUT_PUSH == "true" ]]; then
echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}" which is required to push.' >&2
exit 1
fi

echo "Configuring Git username, email, and pull behavior..."

# Fix #56
git config --global --add safe.directory "*"

git config --local user.name "${INPUT_GIT_NAME}"
git config --local user.email "${INPUT_GIT_EMAIL}"
git config --local pull.rebase true
@@ -28,7 +34,12 @@ echo "${PIP_CMD[@]}"
"${PIP_CMD[@]}"
echo "Commitizen version: $(cz version)"

if [[ $INPUT_WORKING_DIRECTORY ]]; then
cd $INPUT_WORKING_DIRECTORY
fi

PREV_REV="$(cz version --project)"
echo "PREVIOUS_REVISION=${PREV_REV}" >>"$GITHUB_ENV"

CZ_CMD=('cz')
if [[ $INPUT_DEBUG == 'true' ]]; then
@@ -50,15 +61,27 @@ fi
if [[ $INPUT_PRERELEASE ]]; then
CZ_CMD+=('--prerelease' "$INPUT_PRERELEASE")
fi
if [[ $INPUT_DEVRELEASE ]]; then
CZ_CMD+=('--devrelease' "$INPUT_DEVRELEASE")
fi
if [[ $INPUT_LOCAL_VERSION == 'true' ]]; then
CZ_CMD+=('--local-version')
fi
if [[ $INPUT_COMMIT == 'false' ]]; then
CZ_CMD+=('--files-only')
fi
if [[ $INPUT_INCREMENT ]]; then
CZ_CMD+=('--increment' "$INPUT_INCREMENT")
fi
if [[ $INPUT_CHECK_CONSISTENCY ]]; then
if [[ $INPUT_CHECK_CONSISTENCY == 'true' ]]; then
CZ_CMD+=('--check-consistency')
fi
if [[ $INPUT_GIT_REDIRECT_STDERR == 'true' ]]; then
CZ_CMD+=('--git-output-to-stderr')
fi
if [[ $INPUT_MANUAL_VERSION ]]; then
CZ_CMD+=("$INPUT_MANUAL_VERSION")
fi
if [[ $INPUT_CHANGELOG_INCREMENT_FILENAME ]]; then
CZ_CMD+=('--changelog-to-stdout')
echo "${CZ_CMD[@]}" ">$INPUT_CHANGELOG_INCREMENT_FILENAME"
@@ -67,6 +90,11 @@ else
echo "${CZ_CMD[@]}"
"${CZ_CMD[@]}"
fi
if [[ $INPUT_ACTOR ]]; then
ACTOR=$INPUT_ACTOR
else
ACTOR=$GITHUB_ACTOR
fi

REV="$(cz version --project)"
if [[ $REV == "$PREV_REV" ]]; then
@@ -75,20 +103,21 @@ fi
echo "REVISION=${REV}" >>"$GITHUB_ENV"
echo "version=${REV}" >>"$GITHUB_OUTPUT"

GITHUB_DOMAIN=${GITHUB_SERVER_URL#*//}
CURRENT_BRANCH="$(git branch --show-current)"
INPUT_BRANCH="${INPUT_BRANCH:-$CURRENT_BRANCH}"
INPUT_REPOSITORY="${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}"

echo "Repository: ${INPUT_REPOSITORY}"
echo "Actor: ${GITHUB_ACTOR}"
echo "Actor: ${ACTOR}"

if [[ $INPUT_PUSH == 'true' ]]; then
if [[ $INPUT_MERGE != 'true' && $GITHUB_EVENT_NAME == 'pull_request' ]]; then
echo "Refusing to push on pull_request event since that would merge the pull request." >&2
echo "You probably want to run on push to your default branch instead." >&2
else
echo "Pushing to branch..."
REMOTE_REPO="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${INPUT_REPOSITORY}.git"
REMOTE_REPO="https://${ACTOR}:${INPUT_GITHUB_TOKEN}@${GITHUB_DOMAIN}/${INPUT_REPOSITORY}.git"
git pull "$REMOTE_REPO" "$INPUT_BRANCH"
git push "$REMOTE_REPO" "HEAD:${INPUT_BRANCH}" --tags
fi