Skip to content

Commit 5b027af

Browse files
authored
Merge pull request #11 from crqra/feat/custom-git-config
Enable customization of git config
2 parents a236b01 + 1346855 commit 5b027af

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

Diff for: README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ 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 | - |
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'` | - |
72-
| `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` | - |
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'` | - |
72+
| `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` | - |
73+
| `git_name` | Name used to configure git (for git operations) | `github-actions[bot]` |
74+
| `git_email` | Email address used to configure git (for git operations) | `github-actions[bot]@users.noreply.github.com` |
7375

7476
<!-- | `changelog` | Create changelog when bumping the version | true | -->
7577

Diff for: action.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,12 @@ inputs:
3434
default: ''
3535
changelog_increment_filename:
3636
description: 'Filename to store the incremented generated changelog. This is different to changelog as it only contains the changes for the just generated version'
37-
required: false
37+
required: false
38+
git_name:
39+
description: 'Name used to configure git (for git operations)'
40+
required: false
41+
default: 'github-actions[bot]'
42+
git_email:
43+
description: 'Email address used to configure git (for git operations)'
44+
required: false
45+
default: 'github-actions[bot]@users.noreply.github.com'

Diff for: entrypoint.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ cz version
2525

2626

2727
echo "Configuring git user and email..."
28-
git config --local user.email "[email protected]"
29-
git config --local user.name "GitHub Action"
28+
git config --local user.name "$INPUT_GIT_NAME"
29+
git config --local user.email "$INPUT_GIT_EMAIL"
30+
echo "Git name: $(git config --get user.name)"
31+
echo "Git email: $(git config --get user.email)"
3032

3133

3234
echo "Running cz: $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE"

0 commit comments

Comments
 (0)