移除过时注释;修复url残缺引起的无itemType;修复知网引用数字段名;修复页面抓取无页码;更新测试用例 #136
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: Auto update translator metadata | |
on: | |
push: | |
branches: | |
- master | |
- test | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# copy git 仓库到虚拟机上 | |
- name: 'Checkout codes' | |
uses: actions/checkout@v3 | |
- name: Git init | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
git clean -f # Remove untrack file | |
- name: Update metadata | |
id: update_metadata | |
run: | | |
python metadata.py | |
- name: check update | |
id: modified | |
run: | | |
counts=`git status | grep "data/translators.json" | wc -l` | |
echo "counts=${counts}" >> $GITHUB_ENV | |
- name: Update and mirror | |
if: env.counts == 1 | |
run: | | |
git status | |
echo ${{ env.counts }} | |
git add data/translators.json | |
git commit -m 'update translator metadata' | |
git push | |
- uses: wearerequired/git-mirror-action@master #开源actions包 | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
with: | |
source-repo: "[email protected]:l0o0/translators_CN.git" # github仓库地址 | |
destination-repo: "[email protected]:goonback/translators_CN.git" # gitee仓库地址 |