This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
Update Stop Words #530
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: 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 |