Skip to content

Commit 22bb249

Browse files
authored
feat: add prerelease option
* feat: add prerelease option * doc: add doc for prerelease setting * fix: typo in prerelease argument * fix: typo in action config prerelease * refactor: bump system allow DRY_RUN CHANGELOG PRERELEASE work together * fix: change name for publish action * doc: rename github action to allow publishing * fix: doc add in readme prerelease line * fix: remove default arg for fix ci * fix: use right var for prerelease * Update README.md * Update action.yml * Update .cz.toml * Update CHANGELOG.md
1 parent 2bbe22c commit 22bb249

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Add [commitizen][cz] incredibly fast into your project!
44

55
## Features
66

7+
- Allow prerelease
78
- Super easy to setup
89
- Automatically bump version
910
- Automatically create changelog
@@ -66,6 +67,7 @@ jobs:
6667
| `dry_run` | Run without creating commit, output to stdout | false |
6768
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
6869
| `branch` | Destination branch to push changes | `master` |
70+
| `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - |
6971

7072
<!-- | `changelog` | Create changelog when bumping the version | true | -->
7173

action.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ branding:
99
inputs:
1010
dry_run:
1111
description: 'Run without creating commit, output to stdout'
12-
default: "false"
12+
required: false
13+
prerelease:
14+
description: 'Set as prerelease version'
1315
required: false
1416
changelog:
1517
description: 'Create changelog when bumping the version'

entrypoint.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3-
: "${INPUT_DRY_RUN:=false}"
3+
if [ $INPUT_DRY_RUN ]; then INPUT_DRY_RUN='--dry-run'; else INPUT_DRY_RUN=''; fi
4+
if [ $INPUT_CHANGELOG ]; then INPUT_CHANGELOG='--changelog'; else INPUT_CHANGELOG=''; fi
5+
if [ $INPUT_PRERELEASE ]; then INPUT_PRERELEASE="--prerelease $INPUT_PRERELEASE"; else INPUT_PRERELEASE=''; fi
46
INPUT_BRANCH=${INPUT_BRANCH:-master}
57
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
68
# : "${INPUT_CHANGELOG:=true}" ignroed for now, let's check that it works
@@ -27,13 +29,10 @@ echo "Configuring git user and email..."
2729
git config --local user.email "[email protected]"
2830
git config --local user.name "GitHub Action"
2931

30-
if ! $INPUT_DRY_RUN; then
31-
echo "Running cz..."
32-
cz bump --yes --changelog
33-
else
34-
echo "Running dry run cz..."
35-
cz bump --yes --changelog --dry-run
36-
fi
32+
33+
echo "Running cz: $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE"
34+
cz bump --yes $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE
35+
3736

3837
echo "Pushing to branch..."
3938
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"

0 commit comments

Comments
 (0)