Skip to content

Enable customization of git config #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ 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` | - |
| 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` |

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

Expand Down
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ inputs:
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'
required: false
required: false
git_name:
description: 'Name used to configure git (for git operations)'
required: false
default: 'github-actions[bot]'
git_email:
description: 'Email address used to configure git (for git operations)'
required: false
default: 'github-actions[bot]@users.noreply.github.com'
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ cz version


echo "Configuring git user and email..."
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.name "$INPUT_GIT_NAME"
git config --local user.email "$INPUT_GIT_EMAIL"
echo "Git name: $(git config --get user.name)"
echo "Git email: $(git config --get user.email)"


echo "Running cz: $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE"
Expand Down