Skip to content

Commit 708d825

Browse files
committed
Pin versions and improve error message.
1 parent bafd935 commit 708d825

File tree

4 files changed

+45
-14
lines changed

4 files changed

+45
-14
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
- package-ecosystem: "nuget"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Sign files
3232
uses: ./actions/code-signing
3333
with:
34-
client-id: ${{secrets.AZURE_CLIENT_ID}}
35-
tenant-id: ${{secrets.AZURE_TENANT_ID}}
36-
subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}}
37-
directory: files-to-sign
34+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
35+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
36+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37+
directory: ${{ github.workspace }}\files-to-sign
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"sign": {
6+
"version": "0.9.1-beta.26102.1",
7+
"commands": [
8+
"sign"
9+
]
10+
}
11+
}
12+
}

actions/code-signing/action.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)