lang&zs-2.4.1-11/28 #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Paratranz To Lang And Zs | |
on: | |
issues: | |
types: [ opened ] | |
env: | |
PARATRANZ_TOKEN: ${{ secrets.PARATRANZ_TOKEN }} | |
PARATRANZ_PROJECT_ID: ${{ secrets.PARATRANZ_PROJECT_ID }} | |
jobs: | |
check-and-parse-issue: | |
if: contains(github.event.issue.labels.*.name, '自动化:paratranz→lang+zs') | |
name: Check And Parse Issue | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout MuXiu1997/GTNH-translation-compare | |
uses: actions/checkout@v3 | |
with: | |
repository: MuXiu1997/GTNH-translation-compare | |
ref: rework | |
- name: Ensure Dependencies | |
uses: ./.github/actions/ensure-dependencies | |
- name: Run Script | |
id: check-and-parse-issue | |
env: | |
GITHUB_ISSUE: ${{ toJSON(github.event.issue) }} | |
VALID_LABEL: 自动化:paratranz→lang+zs | |
VALID_USER: ${{ github.repository_owner }} | |
run: | | |
poetry run python main.py parse-issue paratranz-to-lang-and-zs | |
outputs: | |
passed: ${{ steps.check-and-parse-issue.outputs.passed }} | |
branch: ${{ steps.check-and-parse-issue.outputs.branch }} | |
close-issue: | |
name: Close Issue | |
needs: check-and-parse-issue | |
if: ${{ needs.check-and-parse-issue.outputs.passed != 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Close Issue | |
uses: peter-evans/[email protected] | |
with: | |
comment: | | |
此模板仅由内部人员使用,已自动关闭。 | |
paratranz-to-lang-and-zs: | |
name: Paratranz To Lang And Zs | |
needs: check-and-parse-issue | |
if: ${{ needs.check-and-parse-issue.outputs.passed == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout MuXiu1997/GTNH-translation-compare | |
uses: actions/checkout@v3 | |
with: | |
repository: MuXiu1997/GTNH-translation-compare | |
ref: rework | |
- name: Ensure Dependencies | |
uses: ./.github/actions/ensure-dependencies | |
- name: Checkout Work Repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.check-and-parse-issue.outputs.branch }} | |
path: '.repo' | |
- name: Run Script | |
run: >- | |
poetry run python main.py action paratranz-to-lang-and-zs | |
--repo-path='.repo' | |
--issue='${{ github.event.issue.number }}' | |
- name: Create PR | |
uses: peter-evans/[email protected] | |
with: | |
title: '[自动化] 更新 语言文件 + 脚本' | |
labels: | | |
自动化:paratranz→lang+zs | |
body: | | |
- 由 #${{ github.event.issue.number }} 触发 | |
base: ${{ needs.check-and-parse-issue.outputs.branch }} | |
branch: automation/compare/${{ github.event.issue.number }} | |
path: '.repo' | |
delete-branch: true |