Skip to content

Add SpeechRecognition service source and chat/social voice transcript… #853

Add SpeechRecognition service source and chat/social voice transcript…

Add SpeechRecognition service source and chat/social voice transcript… #853

name: Update locale files
permissions:
contents: write
on:
push:
branches:
- master
paths:
- 'src/public/locales/**.json'
- '**/home_registry.json'
- '**/locales.json'
tags-ignore:
- '*'
pull_request:
branches:
- master
types: [opened, synchronize, reopened]
paths:
- 'src/public/locales/**.json'
- '**/home_registry.json'
- '**/locales.json'
workflow_dispatch:
jobs:
update-locales:
runs-on: ubuntu-latest
steps:
# 用分支名检出(PR 用 head 分支,push 用 ref_name),以便本地存在 refs/heads/<branch>,供后续 push 引用(避免 detached HEAD 导致 reference not found)
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}
- name: run script to update locale files
run: |
pip install deep_translator json5 pathspec
python ./.esh/commands/update-locales.py
- name: git add all
run: git add -A
# pull_request 时 github.ref 仍为 refs/pull/N/merge,需在 push 显式指定源分支。
- name: Push changes
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: actions-go/push@master
with:
author-email: taromati2@outlook.com
author-name: Taromati2
commit-message: 'file update~'
remote: origin
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.head_ref) || github.ref }}
remote-ref: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.head_ref) || github.ref }}