Run Python Scripts #582
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: Run Python Scripts | |
on: | |
schedule: | |
# Runs github.auto.py at 9:00, 12:00, 18:00, and 21:00 UTC every day | |
- cron: "0 9,20 * * *" | |
# Runs github.auto.reply.py at 8:00, 13:00, and 19:30 UTC every day | |
- cron: "0 8,13 * * *" | |
- cron: "30 19 * * *" | |
jobs: | |
run-scripts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.9" # Replace with your Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Log before running the script | |
- name: Log environment variables | |
run: printenv # Prints the environment variables to see if they are correctly set | |
- name: Log current directory | |
run: pwd # Print the current directory to ensure the correct working directory | |
- name: List files in directory | |
run: ls -al # List all files and directories to confirm your script is in the right place | |
# Run the first script | |
- name: Run github.auto.py | |
run: | | |
echo "Running github.auto.py..." | |
python github.auto.py # Add this step to run your script | |
env: | |
MONGO_URI: ${{ secrets.MONGO_URI }} | |
# Run the second script | |
- name: Run github.auto.reply.py | |
run: | | |
echo "Running github.auto.reply.py..." | |
python github.auto.reply.py # Add this step to run your second script | |
env: | |
MONGO_URI: ${{ secrets.MONGO_URI }} |