Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Update Stop Words

Update Stop Words #531

Workflow file for this run

name: Update Stop Words
on:
push:
branches: [ main ]
schedule:
- cron: 0 23 * * *
env:
TZ: Asia/Shanghai
jobs:
Update_Stop_Words:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@main
- name: Setup Python 3.9.x
uses: actions/setup-python@v2
with:
python-version: '3.9.x'
- name: Install Dependencies
run: |
sudo timedatectl set-timezone "$TZ"
python -m pip install --upgrade pip
pip install --pre gql[all]
pip install requests
pip install pypinyin
- name: Download Stop Words
run: python stopwords.py
- name: Commit Changes
id: commit
run: |
if [ -z "$(git status --porcelain)" ]; then
exit 0
else
echo "::set-output name=status::success"
git add .
git config --local user.email "[email protected]"
git config --local user.name "217heidai"
git commit -m "Updated at $(date)" -a
fi
- name: GitHub Push
if: steps.commit.outputs.status == 'success' && !cancelled()
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Delete Workflow Runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 30
keep_minimum_runs: 10