Daily Python Script Run #847
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: Daily Python Script Run | |
| on: | |
| schedule: | |
| - cron: '55 3 * * *' | |
| # # Runs at 7:00 AM UTC from March to October (10 AM IDT, UTC+3) | |
| # - cron: '55 3 * 3-10 *' | |
| # # Runs at 8:00 AM UTC from November to December (10 AM IST, UTC+2) | |
| # - cron: '55 7 * 11-12 *' | |
| # # Runs at 8:00 AM UTC from January to February (10 AM IST, UTC+2) | |
| # - cron: '55 7 * 1-2 *' | |
| workflow_dispatch: # Allows manual triggering | |
| permissions: | |
| contents: write | |
| jobs: | |
| run-script: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.10' # Specify the Python version you need | |
| - name: Install dependencies (if any) | |
| run: | | |
| pip install requests feedparser | |
| - name: Run the script | |
| run: python main.py ${{ secrets.URL }} Criterias/QEC.json last_published.json | |
| env: | |
| URL: ${{ secrets.URL }} | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Commit state changes | |
| run: | | |
| git add last_published.json | |
| if ! git diff --staged --quiet; then | |
| git commit -m "chore: update published-paper state" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |