Skip to content

Commit 8dcfb6d

Browse files
committed
build-and-deploy: allow acting on behalf of a user
Just like we changed the `open-pr` workflow to allow for the GitForWindowsHelper GitHub App to act on a user's behalf, we want the `build-and-deploy` workflow to be run in the same way. Let's allow specifying explicitly on whose behalf we're running this, so that the commit author can be configured correctly. Also: It is quite common for users not to publish their email addresses in their GitHub profile, which is totally okay. While already in the area, let's deal with this in an elegant way. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a960041 commit 8dcfb6d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
ref:
1717
description: 'The ref containing the package definition'
1818
required: true
19+
actor:
20+
description: The GitHub user on whose behalf this workflow is run
21+
required: false
1922

2023
env:
2124
PACKAGE_TO_BUILD: "${{ github.event.inputs.package }}"
@@ -25,7 +28,7 @@ env:
2528
REF: "${{ github.event.inputs.ref }}"
2629
GPG_OPTIONS: "--batch --yes --no-tty --list-options no-show-photos --verify-options no-show-photos --pinentry-mode loopback"
2730
HOME: "${{ github.workspace }}\\home"
28-
ACTOR: "${{ github.triggering_actor }}"
31+
ACTOR: "${{ github.event.inputs.actor || github.triggering_actor }}"
2932

3033
jobs:
3134
build:
@@ -100,7 +103,7 @@ jobs:
100103
`/users/${process.env.ACTOR}`
101104
)
102105
core.setOutput('name', answer.name)
103-
core.setOutput('email', answer.email)
106+
core.setOutput('email', answer.email || `${process.env.ACTOR}@users.noreply.github.com`)
104107
105108
- name: Configure build
106109
shell: bash

0 commit comments

Comments
 (0)