yams/.github/workflows/act-sanity.yml
trvon 8262061e41
ci: check the wrangler content-type flag in the publication sanity step
The #206 revert restored the wrangler upload path, which passes
--content-type, and removed the S3 "ContentType" field this step grepped
for. Act Sanity has failed on experimental since then.

Signed-off-by: trvon <me@trevon.dev>
2026-09-30 17:00:49 -06:00

106 lines
3.5 KiB
YAML

name: Act Sanity
on:
workflow_dispatch: {}
pull_request:
paths:
- ".github/workflows/**"
- ".actrc"
- "packaging/windows/**"
- "scripts/act/**"
permissions:
contents: read
jobs:
workflow-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install actionlint
shell: bash
run: |
set -euo pipefail
VERSION=v1.7.7
curl -fsSL "https://github.com/rhysd/actionlint/releases/download/${VERSION}/actionlint_${VERSION#v}_linux_amd64.tar.gz" \
| tar -xz actionlint
sudo mv actionlint /usr/local/bin/actionlint
actionlint -version
- name: Lint GitHub workflows
shell: bash
run: |
set -euo pipefail
actionlint -color -shellcheck=
windows-script-sanity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PowerShell for local act image
if: github.actor == 'nektos/act'
shell: bash
run: |
set -euo pipefail
if command -v pwsh >/dev/null 2>&1; then
pwsh -NoLogo -NoProfile -Command "\$PSVersionTable.PSVersion.ToString()"
exit 0
fi
sudo apt-get update
sudo apt-get install -y --no-install-recommends powershell
pwsh -NoLogo -NoProfile -Command "\$PSVersionTable.PSVersion.ToString()"
- name: Parse PowerShell packaging scripts
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$files = Get-ChildItem -Path 'packaging/windows' -Filter '*.ps1' -File
foreach ($file in $files) {
$tokens = $null
$errors = $null
[System.Management.Automation.Language.Parser]::ParseFile($file.FullName, [ref]$tokens, [ref]$errors) | Out-Null
if ($errors.Count -gt 0) {
Write-Host "Parse errors in $($file.FullName)"
$errors | ForEach-Object { Write-Host $_.ToString() }
exit 1
}
}
Write-Host "PowerShell parse check passed for packaging/windows/*.ps1"
- name: Validate key packaging hardening invariants
shell: bash
run: |
set -euo pipefail
grep -q "run_id:" .github/workflows/publish-repos.yml
grep -q "workflow_runs" .github/workflows/publish-repos.yml
grep -q '"--content-type"' scripts/ci/publish_repository.py
grep -q "Get-MsiProperty" packaging/windows/generate-winget-manifest.ps1
grep -q "ProductCode: '\$productCode'" packaging/windows/generate-winget-manifest.ps1
windows-hosted-smoke:
if: github.actor != 'nektos/act'
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parse PowerShell packaging scripts (hosted Windows)
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$files = Get-ChildItem -Path 'packaging/windows' -Filter '*.ps1' -File
foreach ($file in $files) {
$tokens = $null
$errors = $null
[System.Management.Automation.Language.Parser]::ParseFile($file.FullName, [ref]$tokens, [ref]$errors) | Out-Null
if ($errors.Count -gt 0) {
Write-Host "Parse errors in $($file.FullName)"
$errors | ForEach-Object { Write-Host $_.ToString() }
exit 1
}
}
Write-Host "PowerShell parse check passed on windows-latest"