ci(fa02): isolated Windows git-apply diagnosis for reproduced clean-install failure [skip ci]
This commit is contained in:
1 parent
a004e9520b
commit
7b44e84054
1 file changed
+42
@@ -5,9 +5,16 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- '.gitea/workflows/datastack-eslint-ci.yml'
|
- '.gitea/workflows/datastack-eslint-ci.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
fa02_security_diagnostic:
|
||||||
|
description: Targeted Windows patch applicability RCA only
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
eslint-windows:
|
eslint-windows:
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.fa02_security_diagnostic != 'true' }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
@@ -31,3 +38,38 @@ jobs:
|
|||||||
npm run lint
|
npm run lint
|
||||||
if ($LASTEXITCODE -ne 0) { throw 'ESLint check failed' }
|
if ($LASTEXITCODE -ne 0) { throw 'ESLint check failed' }
|
||||||
Write-Output 'DATASTACK_ESLINT_PASS'
|
Write-Output 'DATASTACK_ESLINT_PASS'
|
||||||
|
|
||||||
|
fa02-windows-security-diagnostic:
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.fa02_security_diagnostic == 'true' }}
|
||||||
|
runs-on: windows-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: https://dev.ivib.cc
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Reproduce exact Windows git apply compatibility failure without changing repo source
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
git --version
|
||||||
|
git rev-parse HEAD
|
||||||
|
git config --get core.autocrlf
|
||||||
|
Write-Output "FA02_AUTOCrlf_EXIT=$LASTEXITCODE"
|
||||||
|
npm ci --ignore-scripts --no-audit --no-fund
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw 'Windows isolated lock install failed' }
|
||||||
|
$target = 'node_modules/got/dist/source/request-as-event-emitter.js'
|
||||||
|
$patch = 'patches/cloudcmd-got-security.patch'
|
||||||
|
if (!(Test-Path $target)) { throw 'Missing installed got dist target' }
|
||||||
|
Get-FileHash -Algorithm SHA256 -Path $target | Format-Table
|
||||||
|
Select-String -Path $target -Pattern 'redirectUrl =|Redirecting to a different site' | Select-Object -First 5
|
||||||
|
Write-Output 'FA02_DEFAULT_GIT_APPLY_CHECK'
|
||||||
|
git apply --check --verbose $patch
|
||||||
|
Write-Output "FA02_DEFAULT_APPLY_EXIT=$LASTEXITCODE"
|
||||||
|
Write-Output 'FA02_AUTOCrlf_FALSE_GIT_APPLY_CHECK'
|
||||||
|
git -c core.autocrlf=false apply --check --verbose $patch
|
||||||
|
Write-Output "FA02_AUTOCrlf_FALSE_APPLY_EXIT=$LASTEXITCODE"
|
||||||
|
Write-Output 'FA02_NO_INDEX_GIT_APPLY_CHECK'
|
||||||
|
git apply --check --verbose --unsafe-paths $patch
|
||||||
|
Write-Output "FA02_UNSAFE_PATHS_DIAGNOSTIC_EXIT=$LASTEXITCODE"
|
||||||
|
Write-Output 'FA02_WINDOWS_PATCH_DIAGNOSTIC_COMPLETE'
|
||||||
Reference in new issue
Block a user