stable-diffusion-webui-loca.../.github/workflows/Merge.yaml

48 lines
1.2 KiB
YAML

name: Merge i18n
on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- closed
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v3
- name: clone i18n-source
run: git clone https://github.com/Katsuyuki-Karasawa/sd.webui-i18n-source.git template
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: merge translation
run: python './tools/merge.py'
- name: delete ./template
run: rm -rf template
- name: commit files
run: |
if git diff-index --quiet HEAD --; then
echo "No changes detected"
exit 0
else
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "Merge i18n/l10n"
fi
- name: push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main