From d6b3a5b5cd26559f12f175512bdfea948e6ef9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cerqueira?= Date: Mon, 30 Aug 2021 09:30:29 +0000 Subject: [PATCH 1/3] feat: support custom git config --- action.yml | 10 +++++++++- entrypoint.sh | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 1845131..d33c95e 100644 --- a/action.yml +++ b/action.yml @@ -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 \ No newline at end of file + 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: '41898282+github-actions[bot]@users.noreply.github.com' \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 8cd680a..3ecad02 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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" From 54771512c4ccae0d1c99441ca3e6e42eabf2023f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cerqueira?= Date: Mon, 30 Aug 2021 10:11:49 +0000 Subject: [PATCH 2/3] fix: removed id from default git_email --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index d33c95e..075f480 100644 --- a/action.yml +++ b/action.yml @@ -42,4 +42,4 @@ inputs: git_email: description: 'Email address used to configure git (for git operations)' required: false - default: '41898282+github-actions[bot]@users.noreply.github.com' \ No newline at end of file + default: 'github-actions[bot]@users.noreply.github.com' \ No newline at end of file From 1346855f19e585fc804709a586a897ea1d1ecc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cerqueira?= Date: Mon, 30 Aug 2021 10:12:04 +0000 Subject: [PATCH 3/3] docs: document inputs to customize git config --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 753b523..9f6bc4f 100644 --- a/README.md +++ b/README.md @@ -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` |