Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: Added checksum validation #3786

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/build_wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,25 @@ jobs:
name: Windows
runs-on: ${{ matrix.os }}
steps:

- name: Setup WinRM and Password
- name: Setup WinRM and Password (checksum verified)
shell: powershell
run: |
Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "Ansible_password123!" -Force)
New-NetFirewallRule -DisplayName "ALLOW TCP PORT 5986" -Direction inbound -Profile Any -Action Allow -LocalPort 5986 -Protocol TCP
Invoke-WebRequest https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\ConfigureRemotingForAnsible.ps1
.\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
.\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
.\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert
.\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck
$expectedChecksum = "EBA72DF06E3E77709595F75D1D5B4D95B06602429DD2A3F7867406DF875B0C70"
$actualChecksum = Get-FileHash -Path ".\ConfigureRemotingForAnsible.ps1" -Algorithm SHA256 | Select-Object -ExpandProperty Hash
if ($actualChecksum -ne $expectedChecksum) {
Write-Output "Checksum mismatch"
Write-Output "Actual Checksum: $actualChecksum"
Write-Output "Expect Checksum: $expectedChecksum"
exit 1
} else {
.\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
.\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
.\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert
.\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck
}

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand Down