Skip to content

Commit 096e472

Browse files
authored
Add author_{name,email} and committer_{name,email} Inputs (#279)
We recently needed to change the `AUTHOR_NAME` and `AUTHOR_EMAIL` with which an internal bot triggers a PR to our BCR fork and therefore the commit that eventually lands to https://github.com/bazelbuild/bazel-central-registry It probably makes sense to make these two inputs instead of hardcoded.
1 parent e548280 commit 096e472

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

.github/workflows/publish.yaml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ on:
8484
See https://github.com/bazel-contrib/publish-to-bcr/issues/261.
8585
default: true
8686
type: boolean
87+
author_name:
88+
description: |
89+
Commit author name for the BCR entry. Defaults to the actor running the GitHub Actions workflow.
90+
default: ${{ github.actor }}
91+
type: string
92+
author_email:
93+
description: |
94+
Commit author email for the BCR entry. Defaults to the actor running the GitHub Actions workflow.
95+
default: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
96+
type: string
97+
# Default the committer to the GitHub Actions bot
98+
# https://github.com/orgs/community/discussions/26560#discussioncomment-3531273
99+
committer_name:
100+
description: |
101+
Name of the git committer. Defaults to the GitHub Action bot's name.
102+
default: "github-actions[bot]"
103+
type: string
104+
committer_email:
105+
description: |
106+
Email of the git committer. Defaults to the GitHub Action bot's email.
107+
default: "41898282+github-actions[bot]@users.noreply.github.com"
108+
type: string
87109
secrets:
88110
publish_token:
89111
required: true
@@ -237,16 +259,13 @@ jobs:
237259
env:
238260
# Set the author to the actor of this workflow. Use the github-provided
239261
# noreply email address: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address.
240-
AUTHOR_NAME: ${{ github.actor }}
241-
AUTHOR_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
262+
AUTHOR_NAME: ${{ inputs.author_name }}
263+
AUTHOR_EMAIL: ${{ inputs.author_email }}
264+
COMMITTER_NAME: ${{ inputs.committer_name }}
265+
COMMITTER_EMAIL: ${{ inputs.committer_email }}
242266
run: |
243267
set -o errexit -o nounset -o pipefail
244268
245-
# Set committer to the GitHub Actions bot
246-
# https://github.com/orgs/community/discussions/26560#discussioncomment-3531273
247-
COMMITTER_NAME="github-actions[bot]"
248-
COMMITTER_EMAIL="41898282+github-actions[bot]@users.noreply.github.com"
249-
250269
# Use an authorized remote url to push to the fork
251270
git remote add authed-fork https://x-access-token:${{ secrets.publish_token }}@github.com/${REGISTRY_FORK}.git
252271

0 commit comments

Comments
 (0)