Skip to content

Commit 86fdfe5

Browse files
Merge pull request #11 from DevResults/fix-signing
Instance Export: Fix script signing
2 parents f5c2f5a + fee1f8a commit 86fdfe5

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,24 @@ jobs:
2525
env:
2626
PFX_PWORD: ${{ secrets.PFX_PWORD }}
2727
PFX_CONTENT: ${{ secrets.BASE64_PFX_CONTENT }}
28+
ROOT_CONTENT: ${{ secrets.BASE64_ROOT_CONTENT }}
2829
run: |
2930
cd ./InstanceExport/PowerShell;
31+
32+
$rootPath = Join-Path -Path ./ -ChildPath "root.cer";
33+
$encodedBytes = [System.Convert]::FromBase64String($env:ROOT_CONTENT);
34+
Set-Content $rootPath -Value $encodedBytes -AsByteStream;
35+
Import-Certificate -FilePath ./root.cer -CertStoreLocation Cert:\LocalMachine\Root
36+
3037
$PWord = $env:PFX_PWORD;
3138
$Password = ConvertTo-SecureString -String $PWord -AsPlainText -Force;
3239
$pfxPath = Join-Path -Path ./ -ChildPath "cert.pfx";
3340
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
3441
Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
3542
$cert = Import-PfxCertificate -FilePath ./cert.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $Password
36-
Set-AuthenticodeSignature InstanceExport.ps1 $cert
43+
44+
$sig = Set-AuthenticodeSignature InstanceExport.ps1 $cert -ErrorAction Stop
45+
if ($sig.Status -ne 'Valid') { throw $sig.StatusMessage }
3746
shell: pwsh
3847
- name: Create Release
3948
if: startsWith(github.ref, 'refs/tags/')

InstanceExport/PowerShell/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ At DevResults we value the concept that your data belongs to _you_, and you have
44

55
In order to use it, you should:
66

7-
1. Download the [InstanceExport.ps1](https://raw.githubusercontent.com/DevResults/DevResultsTools/main/InstanceExport/PowerShell/InstanceExport.ps1) PowerShell script available in this repo to your machine. One way to do this is to right click the link to the file name in the previous sentence and choose "Save link as..." to produce a save dialog box.
7+
1. Download the [InstanceExport.ps1](https://github.com/DevResults/DevResultsTools/releases/download/1.0.2/InstanceExport.ps1) PowerShell script.
88

99
2. Reach out to us at help@devresults.com to request an Instance Export Manifest.
1010

0 commit comments

Comments
 (0)