From 0a9739a2001d29d56cd3cf88674e08f4e1cf75b8 Mon Sep 17 00:00:00 2001 From: Per Tillisch Date: Fri, 28 Feb 2025 07:42:43 -0800 Subject: [PATCH 1/2] Assign commits to the standard GitHub Actions bot The action and reusable workflow commits the generated documentation to the repository. A username and email address must be configured for this commit. Previously, an arbitrary GitHub account was used for this purpose. It is questionable whether it is appropriate to attribute commits to an arbitrary user who didn't make them and which was not explicitly provided for such a purpose. In addition, doing so is problematic because we require all contributors to sign a CLA, and so we would need to set up an exemption for this arbitrary user in order to allow the commits to pass the CLA signing check. So the better approach is to assign the commit to the standard GitHub Actions bot account. This account is already assigned machine generated commits by the infrastructure of several of Arduino's repositories and is already exempted from the CLA check. An alternative would have been to use Arduino's general purpose "ArduinoBot" machine account. This account is assigned automated commits by some infrastructure used exclusively in Arduino's own projects. However, the "arduino/render-docs-github-action" action and reusable workflow may also be used in projects not owned by Arduino, and it probably isn't appropriate to assign commits to ArduinoBot in those repositories. --- .github/workflows/render-docs.yml | 4 ++-- action.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/render-docs.yml b/.github/workflows/render-docs.yml index 1be2a9e..586d873 100644 --- a/.github/workflows/render-docs.yml +++ b/.github/workflows/render-docs.yml @@ -107,6 +107,6 @@ jobs: uses: EndBug/add-and-commit@v9 with: add: "${{ inputs.target-path }}" - author_name: "GitHub Action" - author_email: "action@github.com" + author_name: "github-actions[bot]" + author_email: "41898282+github-actions[bot]@users.noreply.github.com" message: "${{ inputs.commit-message }}" diff --git a/action.yml b/action.yml index b54aeb7..f4f98aa 100644 --- a/action.yml +++ b/action.yml @@ -85,6 +85,6 @@ runs: uses: EndBug/add-and-commit@v9 with: add: "${{ inputs.target-path }}" - author_name: "GitHub Action" - author_email: "action@github.com" + author_name: "github-actions[bot]" + author_email: "41898282+github-actions[bot]@users.noreply.github.com" message: "${{ inputs.commit-message }}" From a702b225721b91667cb3ea1bf344842d898b6d20 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 13 Mar 2025 05:01:14 -0700 Subject: [PATCH 2/2] 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. --- .github/workflows/render-docs.yml | 12 ++++++++++-- README.md | 2 ++ action.yml | 10 ++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/render-docs.yml b/.github/workflows/render-docs.yml index 586d873..2056d14 100644 --- a/.github/workflows/render-docs.yml +++ b/.github/workflows/render-docs.yml @@ -38,6 +38,14 @@ on: description: 'Commit message' default: 'Update documentation' type: string + committer-name: + description: 'Username to use as author of the commit.' + default: 'github-actions[bot]' + type: string + committer-email: + description: 'Email address to use as author of the commit.' + default: '41898282+github-actions[bot]@users.noreply.github.com' + type: string debug: description: 'Enable debugging mode to provide additional output' default: false @@ -107,6 +115,6 @@ jobs: uses: EndBug/add-and-commit@v9 with: add: "${{ inputs.target-path }}" - author_name: "github-actions[bot]" - author_email: "41898282+github-actions[bot]@users.noreply.github.com" + author_name: "${{ inputs.committer-name }}" + author_email: "${{ inputs.committer-email }}" message: "${{ inputs.commit-message }}" diff --git a/README.md b/README.md index 1790322..a529afd 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,8 @@ The workflow has a couple of inputs that allows to configure the behaviour: - `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. - `commit` Defines whether the rendered markdown files should be committed to the repository automatically. - `commit-message` Defines the commit message to be used when `commit` is set to true. +- `committer-name` Username to use as the author of the commit. Defaults to "github-actions[bot]". +- `committer-email` Email address to use as the author of the commit. Defaults to the email for "github-actions[bot]". - `debug` Enable this option to get additional output from the tool. This allows to debug in case you get unexpected output from the command. ## 🐛 Reporting Issues diff --git a/action.yml b/action.yml index f4f98aa..5a6a335 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,12 @@ inputs: commit-message: description: 'Commit message' default: 'Update documentation' + committer-name: + description: 'Username to use as author of the commit.' + default: 'github-actions[bot]' + committer-email: + description: 'Email address to use as author of the commit.' + default: '41898282+github-actions[bot]@users.noreply.github.com' debug: description: 'Enable debugging mode to provide additional output' default: 'false' @@ -85,6 +91,6 @@ runs: uses: EndBug/add-and-commit@v9 with: add: "${{ inputs.target-path }}" - author_name: "github-actions[bot]" - author_email: "41898282+github-actions[bot]@users.noreply.github.com" + author_name: "${{ inputs.committer-name }}" + author_email: "${{ inputs.committer-email }}" message: "${{ inputs.commit-message }}"