Skip to content

Commit f72d1f0

Browse files
committed
Use appropriate indicator for Windows signing determination in build workflow
The "build" workflow signs the Windows builds of the application. The signing process relies on access to GitHub Actions secrets. For this reason, the workflow is configured to only sign the builds when it has access to GitHub Actions secrets to avoid spurious failures of the workflow that would otherwise be caused by signing failure. Previously the signing was determined based on the value of the `github.event.pull_request.head.repo.fork` context item. That was effective for the use case of the workflow being triggered by a pull request from a fork (for security reasons, GitHub Actions does not give access to secrets under these conditions). However, there is another context under which the workflow might run without access to the signing secrets, for which the use of context item is not appropriate. It is important to support the use of the workflow in forks of the repository. In addition to the possible value to hard forked projects, this is essential to allow conscientious contributors to test contributions to the build and release system in their own fork prior to submitting a pull request. The previous configuration would cause a workflow run performed by a contributor in a fork to attempt to sign the Windows build. Unless the contributor had set up the ridiculously complex infrastructure required to perform the signing for the Windows build, which is utterly infeasible, this would cause the workflow to fail spuriously. The appropriate approach, which has been the established convention in the rest of the workflow code, is to use the secret itself when determining whether to attempt the signing process. If the secret is not defined (resulting in it having an empty string value), then the signing should be skipped. If it is defined, then the signing should be performed.
1 parent 0fe0fea commit f72d1f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ jobs:
290290
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"
291291
WIN_CERT_PASSWORD: ${{ secrets[matrix.config.certificate-password-secret] }}
292292
WIN_CERT_CONTAINER_NAME: ${{ secrets[matrix.config.certificate-container] }}
293-
WIN_SIGNING_ENABLED: ${{ !github.event.pull_request.head.repo.fork }}
293+
WIN_SIGNING_ENABLED: ${{ secrets[matrix.config.certificate-password-secret] != '' }}
294294

295295
strategy:
296296
matrix:

0 commit comments

Comments
 (0)