Skip to content

Update check.yml

Update check.yml #13

Workflow file for this run

# XXXXXXXX
name: Check Pull Request
on:
pull_request:
branches: [ '*' ] # 可以指定分支,或者用 * 表示所有分支
push:
branches: [ '*' ] # 可以指定分支,或者用 * 表示所有分支
#paths:
# - 'json/localization.json' # 仅当推送此文件时触发
jobs:
Configuration_Environment:
runs-on: windows-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: utf8
# 使用utf8编码环境编译
run: chcp 65001
- name: Download Data_json
shell: pwsh
run: Invoke-WebRequest -Uri "https://api.github.com/repos/desktop/desktop/releases/latest" -OutFile "${{github.workspace}}\release.json"
- name: Download GitHubDesktop2Chinese.exe
shell: pwsh
run: Invoke-WebRequest -Uri "https://github.com/cngege/GitHubDesktop2Chinese/releases/latest/download/GitHubDesktop2Chinese.exe" -OutFile "${{github.workspace}}\GitHubDesktop2Chinese.exe"
- name: Parse json_file,Read download url
shell: pwsh
id: forjson
run: |
$jsonContent = Get-Content -Path '${{github.workspace}}\release.json' -Raw
$jsonObj = ConvertFrom-Json -InputObject $jsonContent
echo "browser_download_url=$($jsonObj.assets[4].browser_download_url)" >> "$GITHUB_OUTPUT"
echo "A${{ steps.forjson.outputs.browser_download_url }}"
- name: download github desktop
shell: pwsh
run: |
echo "A${{ steps.forjson.outputs.browser_download_url }}"
Invoke-WebRequest -Uri "${{ steps.forjson.outputs.browser_download_url }}" -OutFile "${{github.workspace}}\GitHubDesktop_full.zip"
- name: unzip GitHub Desktop Full
shell: pwsh
run: |
Expand-Archive -Path "${{github.workspace}}\GitHubDesktop_full.zip" -DestinationPath "${{github.workspace}}\GitHubDesktopFull" -Force
- name: run and check GitHubDesktop2Chinese.exe
shell: pwsh
run: |
${{github.workspace}}\GitHubDesktop2Chinese.exe --nopause -j "json/localization.json" -g "${{github.workspace}}\GitHubDesktopFull\lib\net45\resources\app" dev --invalidcheck
- name: Test Tree
shell: pwsh
run: tree . /A /F