Skip to content

Update main.yml

Update main.yml #24

Workflow file for this run

name: Run Python Script and Commit CSV
on:
push:
branches:
- main # 触发动作的分支
schedule:
# 每天UTC时间00:00运行,按需调整
- cron: '0 0 * * *'
jobs:
build-and-commit-csv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # 你的 Python 版本
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pywencai
- name: Run Python script
run: |
python popularity.py
env:
CSV_FILE_NAME: ${{ secrets.CSV_FILE_NAME }.csv}

Check failure on line 32 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / Run Python Script and Commit CSV

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 32, Col: 24): The expression is not closed. An unescaped ${{ sequence was found, but the closing }} sequence was not found. .github/workflows/main.yml (Line: 38, Col: 15): The expression is not closed. An unescaped ${{ sequence was found, but the closing }} sequence was not found.
- name: Upload CSV as Artifact
uses: actions/upload-artifact@v2
with:
name: wencai-results
path: ${{ secrets.CSV_FILE_NAME }.csv}
- name: Commit and Push CSV to Repository
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -f ${{ secrets.CSV_FILE_NAME }.csv}
git commit -m 'Automatically update and commit ${{ secrets.CSV_FILE_NAME }.csv}' || echo "No changes to commit"
git push origin HEAD:${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}