Dataset #917
This file contains hidden or 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: Dataset | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| update_dataset: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install huggingface-cli | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install huggingface_hub | |
| - name: Login to Hugging Face | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| hf auth login --token "$HF_TOKEN" --add-to-git-credential | |
| - name: Make script executable | |
| run: chmod +x ./* | |
| - name: Run update_dataset.sh | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./update_dataset.sh | |
| - name: Configure git | |
| run: | | |
| git config user.name "eastspire" | |
| git config user.email "root@ltpp.vip" | |
| - name: Commit and push changes | |
| run: | | |
| set -e | |
| if git status --porcelain | grep .; then | |
| git add . | |
| git commit -m "chore: update dataset" | |
| git push origin HEAD:master | |
| echo "✅ Changes pushed to GitHub" | |
| else | |
| echo "ℹ️ No changes to commit" | |
| fi |