github.com/abdfnx/gh-api@v0.0.0-20210414084727-f5432eec23b8/script/setup-windows-certificate.ps1 (about)

     1  $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
     2  $certFile = "$scriptPath\windows-certificate.pfx"
     3  
     4  $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
     5  $headers.Add("Authorization", "token $env:DESKTOP_CERT_TOKEN")
     6  $headers.Add("Accept", 'application/vnd.github.v3.raw')
     7  
     8  Invoke-WebRequest 'https://api.github.com/repos/desktop/desktop-secrets/contents/windows-certificate.pfx' `
     9                -Headers $headers `
    10                -OutFile "$certFile"
    11  
    12  Write-Output "::set-output name=cert-file::$certFile"