diff --git a/README.md b/README.md index fe04d91..148f1ed 100644 --- a/README.md +++ b/README.md @@ -64,26 +64,26 @@ jobs: ## Variables -| Name | Description | Default | -| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | -| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - | -| `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 | `master` | -| `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_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 | -| `commit` | Define if the changes should be committed to the branch. | true | - +| Name | Description | Default | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- | +| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - | +| `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_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 | +| `commit` | Define if the changes should be committed to the branch. | true | +| | ## Outputs -| Name | Description | -| --------- | -------------------- | -| `version` | The new version | +| Name | Description | +| --------- | --------------- | +| `version` | The new version | Additionally, the new version is also availble as an environment variable under `REVISION`. diff --git a/entrypoint.sh b/entrypoint.sh index dcfed11..ad45cea 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,8 @@ if [ $INPUT_DRY_RUN ]; then INPUT_DRY_RUN='--dry-run'; else INPUT_DRY_RUN=''; fi if [ $INPUT_CHANGELOG ]; then INPUT_CHANGELOG='--changelog'; else INPUT_CHANGELOG=''; fi if [ $INPUT_PRERELEASE ]; then INPUT_PRERELEASE="--prerelease $INPUT_PRERELEASE"; else INPUT_PRERELEASE=''; fi if [ "$INPUT_COMMIT" == 'false' ]; then INPUT_COMMIT='--files-only'; else INPUT_COMMIT=''; fi -INPUT_BRANCH=${INPUT_BRANCH:-master} +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) +INPUT_BRANCH=${INPUT_BRANCH:-$CURRENT_BRANCH} INPUT_EXTRA_REQUIREMENTS=${INPUT_EXTRA_REQUIREMENTS:-''} REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY} # : "${INPUT_CHANGELOG:=true}" ignroed for now, let's check that it works