Skip to content

Commit a702b22

Browse files
committed
Make commit author configurable
The users of the action and reusable workflow may wish to attribute commits for the rendered documentation to a specific user. This can now be done via the newly added `committer-name` and `committer-email` action inputs. The inputs are optional, using the GitHub Actions bot account as the default author, as was done before the addition of the inputs.
1 parent 0a9739a commit a702b22

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Diff for: .github/workflows/render-docs.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ on:
3838
description: 'Commit message'
3939
default: 'Update documentation'
4040
type: string
41+
committer-name:
42+
description: 'Username to use as author of the commit.'
43+
default: 'github-actions[bot]'
44+
type: string
45+
committer-email:
46+
description: 'Email address to use as author of the commit.'
47+
default: '41898282+github-actions[bot]@users.noreply.github.com'
48+
type: string
4149
debug:
4250
description: 'Enable debugging mode to provide additional output'
4351
default: false
@@ -107,6 +115,6 @@ jobs:
107115
uses: EndBug/add-and-commit@v9
108116
with:
109117
add: "${{ inputs.target-path }}"
110-
author_name: "github-actions[bot]"
111-
author_email: "41898282+github-actions[bot]@users.noreply.github.com"
118+
author_name: "${{ inputs.committer-name }}"
119+
author_email: "${{ inputs.committer-email }}"
112120
message: "${{ inputs.commit-message }}"

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ The workflow has a couple of inputs that allows to configure the behaviour:
8080
- `fail-on-warnings` The command prints documentation issues such as missing documentation. This option makes the action fail when such issues are found. This allows to achieve 100% documentation coverage.
8181
- `commit` Defines whether the rendered markdown files should be committed to the repository automatically.
8282
- `commit-message` Defines the commit message to be used when `commit` is set to true.
83+
- `committer-name` Username to use as the author of the commit. Defaults to "github-actions[bot]".
84+
- `committer-email` Email address to use as the author of the commit. Defaults to the email for "github-actions[bot]".
8385
- `debug` Enable this option to get additional output from the tool. This allows to debug in case you get unexpected output from the command.
8486

8587
## 🐛 Reporting Issues

Diff for: action.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ inputs:
2727
commit-message:
2828
description: 'Commit message'
2929
default: 'Update documentation'
30+
committer-name:
31+
description: 'Username to use as author of the commit.'
32+
default: 'github-actions[bot]'
33+
committer-email:
34+
description: 'Email address to use as author of the commit.'
35+
default: '41898282+github-actions[bot]@users.noreply.github.com'
3036
debug:
3137
description: 'Enable debugging mode to provide additional output'
3238
default: 'false'
@@ -85,6 +91,6 @@ runs:
8591
uses: EndBug/add-and-commit@v9
8692
with:
8793
add: "${{ inputs.target-path }}"
88-
author_name: "github-actions[bot]"
89-
author_email: "41898282+github-actions[bot]@users.noreply.github.com"
94+
author_name: "${{ inputs.committer-name }}"
95+
author_email: "${{ inputs.committer-email }}"
9096
message: "${{ inputs.commit-message }}"

0 commit comments

Comments
 (0)