mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
ci: 当仅 version.json 的 last_updated 有变动时,回退对应服务器所有资源文件改动 (#10453)
This commit is contained in:
49
.github/workflows/res-update-game.yml
vendored
49
.github/workflows/res-update-game.yml
vendored
@@ -178,51 +178,14 @@ jobs:
|
||||
with:
|
||||
args: -w ${{ steps.task_sorting.outputs.gitdiff }}
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
check-latest: true
|
||||
- name: Check if only sorted and Templates
|
||||
id: check_sorted_templates
|
||||
run: |
|
||||
git status
|
||||
|
||||
$gitdiff = git diff --numstat HEAD 2>$null | findstr -i resource
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Output "no diff"
|
||||
exit 0
|
||||
}
|
||||
|
||||
Write-Output $gitdiff
|
||||
|
||||
$diff = $false
|
||||
$hasPng = $false
|
||||
|
||||
$diffLines = $gitdiff -split "`n"
|
||||
|
||||
foreach ($line in $diffLines) {
|
||||
$parts = $line -split "\s+"
|
||||
$filePath = $parts[2]
|
||||
$firstNumber = $parts[0]
|
||||
$secondNumber = $parts[1]
|
||||
|
||||
if ($filePath -match "\.png$") {
|
||||
$hasPng = $true
|
||||
}
|
||||
|
||||
if ($firstNumber -gt 1 -or $firstNumber -ne $secondNumber) {
|
||||
$diff = $true
|
||||
}
|
||||
|
||||
if ($hasPng -and $diff) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
$changes = $hasPng -or $diff
|
||||
|
||||
Write-Output "diff: $diff"
|
||||
Write-Output "hasPng: $hasPng"
|
||||
Write-Output "changes: $changes"
|
||||
|
||||
Write-Output "contains_png=$hasPng" >> $env:GITHUB_OUTPUT
|
||||
Write-Output "changes=$changes" >> $env:GITHUB_OUTPUT
|
||||
run: node tools/ResourceUpdateValidator/index.mjs
|
||||
|
||||
- name: Setup python
|
||||
if: steps.check_sorted_templates.outputs.contains_png == 'True'
|
||||
|
||||
Reference in New Issue
Block a user