Skip to content

Commit d995bc1

Browse files
committedDec 2, 2020
feat: add extra_requirements parameters instead of reading the requirements.txt file
1 parent bf778a9 commit d995bc1

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed
 

‎README.md

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

55
## Features
66

7-
- Allow prerelease
7+
- Allow prerelease
88
- Super easy to setup
99
- Automatically bump version
1010
- Automatically create changelog
@@ -61,13 +61,14 @@ jobs:
6161
6262
## Variables
6363
64-
| Name | Description | Default |
65-
| -------------- | ------------------------------------------------------------------------------------- | ----------- |
66-
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - |
67-
| `dry_run` | Run without creating commit, output to stdout | false |
68-
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
69-
| `branch` | Destination branch to push changes | `master` |
70-
| `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - |
64+
| Name | Description | Default |
65+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
66+
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - |
67+
| `dry_run` | Run without creating commit, output to stdout | false |
68+
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
69+
| `branch` | Destination branch to push changes | `master` |
70+
| `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - |
71+
| `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'` | - |
7172

7273
<!-- | `changelog` | Create changelog when bumping the version | true | -->
7374

‎action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ inputs:
2828
description: 'Destination branch to push changes'
2929
required: false
3030
default: 'master'
31+
extra_requirements:
32+
description: 'Extra commitizen dependencies like your custom plugins or rules'
33+
required: false
34+
default: ''

‎entrypoint.sh

+5-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if [ $INPUT_DRY_RUN ]; then INPUT_DRY_RUN='--dry-run'; else INPUT_DRY_RUN=''; fi
44
if [ $INPUT_CHANGELOG ]; then INPUT_CHANGELOG='--changelog'; else INPUT_CHANGELOG=''; fi
55
if [ $INPUT_PRERELEASE ]; then INPUT_PRERELEASE="--prerelease $INPUT_PRERELEASE"; else INPUT_PRERELEASE=''; fi
66
INPUT_BRANCH=${INPUT_BRANCH:-master}
7+
INPUT_EXTRA_REQUIREMENTS=${INPUT_EXTRA_REQUIREMENTS:-''}
78
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
89
# : "${INPUT_CHANGELOG:=true}" ignroed for now, let's check that it works
910

@@ -18,14 +19,10 @@ echo "Repository: $REPOSITORY"
1819
echo "Actor: $GITHUB_ACTOR"
1920

2021
echo "Installing requirements..."
21-
if [[ -f "requirements.txt" ]]; then
22-
# Ensure commitizen + reqs may have custom commitizen plugins
23-
pip install -r requirements.txt commitizen
24-
else
25-
pip install commitizen
26-
echo "Commitizen version:"
27-
cz version
28-
fi
22+
pip install commitizen $INPUT_EXTRA_REQUIREMENTS
23+
echo "Commitizen version:"
24+
cz version
25+
2926

3027
echo "Configuring git user and email..."
3128
git config --local user.email "action@github.com"

0 commit comments

Comments
 (0)
Please sign in to comment.