Skip to content

Commit 9b24fb5

Browse files
authored
Update to Trusted Signing module 0.4.1 (#38)
* Add files input and improve file input docs * Update to ps module 0.4.1 * Add documentation for files input * Update docs * Update action.yml * Update README.md
1 parent 38c7621 commit 9b24fb5

File tree

2 files changed

+65
-8
lines changed

2 files changed

+65
-8
lines changed

README.md

+51-4
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
run: dotnet build --configuration Release --no-restore WpfApp
3939

4040
- name: Sign files with Trusted Signing
41-
uses: azure/trusted-signing-action@v0.3.20
41+
uses: azure/trusted-signing-action@v0.4.1
4242
with:
4343
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
4444
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
4545
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
4646
endpoint: https://eus.codesigning.azure.net/
4747
trusted-signing-account-name: vscx-codesigning
4848
certificate-profile-name: vscx-certificate-profile
49-
files-folder: ${{ github.workspace }}\App\App\bin\Release\net6.0-windows
49+
files-folder: ${{ github.workspace }}\App\App\bin\Release\net8.0-windows
5050
files-folder-filter: exe,dll
5151
file-digest: SHA256
5252
timestamp-rfc3161: http://timestamp.acs.microsoft.com
@@ -131,14 +131,22 @@ certificate-profile-name: my-profile-name
131131
```
132132

133133
### File Specification
134+
#### Files List
135+
This strategy allows you to specify a comma separated list of files to be signed.
136+
137+
```yaml
138+
# A comma separated list of absolute paths to the files being signed. Can be combined with the files-folder and file-catalog inputs.
139+
files: ${{ github.workspace }}\files\app.dll,${{ github.workspace }}\files\app.exe
140+
```
141+
134142
#### Files Folder
135-
This strategy allows you to specify a folder that contains all the files you want signed. There are options available for narrowing the focus as well. For example, you can use the `files-folder-filter` input to specify that you only want `exe` files to be signed.
143+
This strategy allows you to specify a folder that contains all the files you want signed. There are options available for narrowing the focus as well. For example, you can use the `files-folder-filter` input to specify that you only want `exe` files to be signed. See [about_Wildcards](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_wildcards) for more information on using wildcards with the `files-folder-filter` input.
136144

137145
```yaml
138146
# The folder containing files to be signed. Can be combined with the file-catalog input.
139147
files-folder: ${{ github.workspace }}\App\App\bin\Release\net6.0-windows
140148
141-
# A comma separated list of file extensions that determines which types of files will be signed in the folder specified by the files-folder input. Any file type not included in this list will not be signed. If this input is not used, all files in the folder will be signed.
149+
# A comma separated list of file extensions that determines which types of files will be signed in the folder specified by the files-folder input. Any file type not included in this list will not be signed. If this input is not used, all files in the folder will be signed. Supports wildcards for matching multiple file names with a pattern.
142150
files-folder-filter: dll,exe,msix
143151
144152
# A boolean value (true/false) that indicates if the folder specified by the files-folder input should be searched recursively. The default value is false.
@@ -148,6 +156,25 @@ files-folder-recurse: true
148156
files-folder-depth: 2
149157
```
150158

159+
Given the following directory structure:
160+
```txt
161+
C:.
162+
└───files
163+
System.dll
164+
Foo.Bar.Core.dll
165+
Foo.Bar.Utilities.dll
166+
Foo.Bar.exe
167+
LICENSE.md
168+
```
169+
170+
Here is an example of inputs that can be used to specify that only the `Foo.Bar.*` files are signed:
171+
```yaml
172+
files-folder: ${{ github.workspace }}\files
173+
files-folder-filter: Foo.Bar.*.dll,*.exe
174+
files-folder-recurse: false
175+
files-folder-depth: 1
176+
```
177+
151178
#### Files Catalog
152179
This strategy allows you to specify a precise list of files to be signed.
153180

@@ -156,6 +183,26 @@ This strategy allows you to specify a precise list of files to be signed.
156183
files-catalog: ${{ github.workspace }}\catalog.txt
157184
```
158185

186+
Given the following directory structure:
187+
```txt
188+
C:.
189+
│ catalog.txt
190+
191+
└───files
192+
System.dll
193+
Foo.Bar.Core.dll
194+
Foo.Bar.Utilities.dll
195+
Foo.Bar.exe
196+
LICENSE.md
197+
```
198+
199+
Here is an example of a `catalog.txt` file that can be used to specify that only the `Foo.Bar.*` files are signed:
200+
```txt
201+
./files/Foo.Bar.Core.dll
202+
./files/Foo.Bar.Utilities.dll
203+
./files/Foo.Bar.exe
204+
```
205+
159206
### Digest Algorithm
160207
```yaml
161208
# The name of the digest algorithm used for hashing the file being signed. The supported values are SHA256, SHA384, and SHA512. The default value is SHA256.

action.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ inputs:
4040
certificate-profile-name:
4141
description: The Certificate Profile name.
4242
required: true
43+
files:
44+
description: A comma separated list of absolute paths to the files being signed. Can be combined with
45+
the files-folder and file-catalog inputs.
46+
required: false
4347
files-folder:
44-
description: The folder containing files to be signed. Can be combined with the file-catalog input.
48+
description: The folder containing files to be signed. Can be combined with the files and file-catalog inputs.
4549
required: false
4650
files-folder-filter:
4751
description: A comma separated list of file extensions that determines which types of files will
4852
be signed in the folder specified by the files-folder input. E.g., 'dll,exe,msix'.
4953
Any file type not included in this list will not be signed. If this input is not used,
50-
all files in the folder will be signed.
54+
all files in the folder will be signed. Supports wildcards for matching multiple file
55+
names with a pattern.
5156
required: false
5257
files-folder-recurse:
5358
description: A boolean value (true/false) that indicates if the folder specified by the files-folder
@@ -60,7 +65,7 @@ inputs:
6065
files-catalog:
6166
description: A file containing a list of relative paths to the files being signed. The paths
6267
should be relative to the location of the catalog file. Each file path should be on
63-
a separate line. Can be combined with the files-folder input.
68+
a separate line. Can be combined with the files and files-folder inputs.
6469
required: false
6570
file-digest:
6671
description: The name of the digest algorithm used for hashing the files being signed. The supported
@@ -197,7 +202,7 @@ runs:
197202
$defaultPath = $env:PSModulePath -split ';' | Select-Object -First 1
198203
"PSMODULEPATH=$defaultPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
199204
200-
"TRUSTED_SIGNING_MODULE_VERSION=0.3.18" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
205+
"TRUSTED_SIGNING_MODULE_VERSION=0.4.1" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
201206
"BUILD_TOOLS_NUGET_VERSION=10.0.22621.3233" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
202207
"TRUSTED_SIGNING_NUGET_VERSION=1.0.53" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
203208
@@ -270,6 +275,11 @@ runs:
270275
$params["CertificateProfileName"] = $certificateProfileName
271276
}
272277
278+
$files = "${{ inputs.files }}"
279+
if (-Not [string]::IsNullOrWhiteSpace($files)) {
280+
$params["Files"] = $files.replace("`n", ",")
281+
}
282+
273283
$filesFolder = "${{ inputs.files-folder }}"
274284
if (-Not [string]::IsNullOrWhiteSpace($filesFolder)) {
275285
$params["FilesFolder"] = $filesFolder

0 commit comments

Comments
 (0)