فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

ci(a08): fail closed on downloaded NSIS archive SHA256 mismatch

Davood Mehraban committed Nov 23, 2026 at 22:15 UTC 3d57e04235b260b4e06ad1d307a015ecd4e538cc
1 file changed +20 -7
.github/workflows/a08-targeted-native-reuse.yml
+20 -7
@@ -61,13 +61,26 @@ jobs:
61 }
62 Write-Host ("Verified candidate run "+$run.html_url+" SHA "+$run.head_sha+
63 " artifact "+$candidate[0].id+" archive digest "+$candidate[0].digest)
64 - - name: Reuse already-built candidate NSIS
65 - uses: actions/download-artifact@v4
66 - with:
67 - run-id: ${{ inputs.artifact_run_id }}
68 - github-token: ${{ github.token }}
69 - name: phase-a-native-candidate-nsis
70 - path: test-installer
64 + - name: Download and independently verify NSIS artifact archive SHA256
65 + shell: pwsh
66 + env:
67 + GH_TOKEN: ${{ github.token }}
68 + SOURCE_RUN: ${{ inputs.artifact_run_id }}
69 + run: |
70 + $ErrorActionPreference='Stop'
71 + $artifacts=gh api "repos/$env:GITHUB_REPOSITORY/actions/runs/$env:SOURCE_RUN/artifacts?per_page=100" | ConvertFrom-Json
72 + $candidate=@($artifacts.artifacts | Where-Object { $_.name -eq 'phase-a-native-candidate-nsis' })
73 + if ($candidate.Count -ne 1 -or $candidate[0].expired -or
74 + $candidate[0].digest -notmatch '^sha256:[a-fA-F0-9]{64}$') { throw 'Candidate artifact is missing or unverifiable' }
75 + $zip=Join-Path $env:RUNNER_TEMP 'verified-a08-nsis.zip'
76 + $headers=@{ Authorization="Bearer $env:GH_TOKEN"; Accept='application/vnd.github+json'; 'X-GitHub-Api-Version'='2022-11-28' }
77 + Invoke-WebRequest -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/artifacts/$($candidate[0].id)/zip" -Headers $headers -OutFile $zip
78 + $actual=(Get-FileHash -LiteralPath $zip -Algorithm SHA256).Hash.ToLowerInvariant()
79 + $expected=($candidate[0].digest -split ':',2)[1].ToLowerInvariant()
80 + if ($actual -ne $expected) { throw "Downloaded artifact archive SHA256 mismatch: $actual" }
81 + New-Item -ItemType Directory -Path test-installer -Force | Out-Null
82 + Expand-Archive -LiteralPath $zip -DestinationPath test-installer -Force
83 + Write-Host "Verified downloaded native artifact archive SHA256: $actual"
84 - name: Run only real installed WebView2 A08 10k/50k benchmark
85 shell: pwsh
86 env: