Azure / trusted-signing-action

MIT License
21 stars 8 forks source link

Error when `file-digest` is not specified. #7

Closed dlemstra closed 1 month ago

dlemstra commented 3 months ago

According to the documentation the file-digest option has a default value but it seems to be mandatory:

Invoke-TrustedSigning: D:\a\_temp\c815337e-83e2-4787-a8a9-87d8a5773ffe.ps1:176
Line |
 176 |  Invoke-TrustedSigning @params
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot process command because of one or more missing mandatory parameters: FileDigest.
Error: Process completed with exit code 1.
[Parameter(Mandatory)]
[string]$FileDigest,

This should probably be changed to this:

[Parameter()]
[string]$FileDigest = "SHA256",

p.s. Are there plans to make this public somewhere: https://www.powershellgallery.com/packages/TrustedSigning/0.3.15 so I could have created a PR instead?

sudara commented 2 months ago

I ran into this as well, #8 adds a default for the GitHub Action.

dlemstra commented 2 months ago

I wonder if we should make his a default in the powershell scripts instead so we don't need to add it here?

japarson commented 2 months ago

p.s. Are there plans to make this public somewhere: powershellgallery.com/packages/TrustedSigning/0.3.15 so I could have created a PR instead?

No plans at this time unfortunately. At this time it's easier to keep that repo private for security reasons. But as you can see, the source code is still available. Feel free to open an issue in this repo even if the problem is related to the module.

I wonder if we should make his a default in the powershell scripts instead so we don't need to add it here?

I think it's best to set the default values in the action whenever we can (as opposed to the module). It's just easier for users to see the defaults there rather than having to examine the module source.

I think the contribution from @sudara fixes this issue by adding the default value.

What are your thoughts, @dlemstra ?

dlemstra commented 2 months ago

Having it as a default here also works and your point that it shows here makes a lot of sense. And for the module I can understand you don't want to automate the publishing of the module but being able to create pull requests for that code would be nice.