@@ -18,35 +18,50 @@ runs:
1818 id : should_sign
1919 shell : pwsh
2020 run : |
21- $shouldSign = $false
22- if ("${{inputs.client-id}}" -ne "" -and "${{inputs.tenant-id}}" -ne "" -and "${{inputs.subscription-id}}" -ne "") {
23- $shouldSign = $true
21+ $shouldSign = $true
22+
23+ if ("${{inputs.client-id}}" -eq "") {
24+ echo "Missing required value: client-id"
25+ $shouldSign = $false
26+ }
27+
28+ if ("${{inputs.tenant-id}}" -eq "") {
29+ echo "Missing required value: tenant-id"
30+ $shouldSign = $false
2431 }
32+
33+ if ("${{inputs.subscription-id}}" -eq "") {
34+ echo "Missing required value: subscription-id"
35+ $shouldSign = $false
36+ }
37+
2538 echo "should_sign=$shouldSign" >> $env:GITHUB_OUTPUT
2639 echo "Should sign: $shouldSign"
2740
2841 - name : Azure CLI login with federated credential
2942 if : steps.should_sign.outputs.should_sign == 'true'
30- uses : azure/login@v2
43+ uses : azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
3144 with :
32- client-id : ${{inputs.client-id}}
33- tenant-id : ${{inputs.tenant-id}}
34- subscription-id : ${{inputs.subscription-id}}
45+ client-id : ${{ inputs.client-id }}
46+ tenant-id : ${{ inputs.tenant-id }}
47+ subscription-id : ${{ inputs.subscription-id }}
3548
3649 - name : Install sign cli
3750 if : steps.should_sign.outputs.should_sign == 'true'
3851 shell : cmd
39- run : dotnet tool install --global sign --prerelease
52+ run : dotnet tool restore
53+ working-directory : ${{ github.action_path }}
4054
4155 - name : Sign executables and libraries
4256 if : steps.should_sign.outputs.should_sign == 'true'
4357 shell : pwsh
4458 run : |
45- sign code trusted-signing `
59+ dotnet tool run sign code trusted-signing `
60+ --base-directory ${{ inputs.directory }} `
4661 --trusted-signing-account ImageMagick `
4762 --trusted-signing-certificate-profile ImageMagick `
4863 --trusted-signing-endpoint https://eus.codesigning.azure.net `
4964 --azure-credential-type azure-cli `
5065 --verbosity information `
5166 *.exe *.dll
52- working-directory : ${{inputs.directory }}
67+ working-directory : ${{ github.action_path }}
0 commit comments