-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.41 KB
/
update-readme.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Update Live Scores
on:
schedule:
- cron: '0 1 * * *' # Runs every day at 1 AM UTC
workflow_dispatch: # Allows manual trigger of the workflow
jobs:
update-scores:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }} # Use the default GitHub token
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git config pull.rebase false # Set to merge
- name: Force pull latest changes
run: |
git fetch origin
git reset --hard origin/main # Adjust if your default branch is different
git clean -fd
- name: List directory contents
run: |
ls -la
ls -la scripts || echo "Scripts directory not found."
- name: Run script
run: |
python scripts/transfermarkt_github.py
- name: Commit changes
run: |
git add .
git commit -m "Update live scores for $(date +'%Y-%m-%d %H:%M:%S')" || echo "No changes to commit"
git push origin main || echo "Failed to push changes" # Adjust if your default branch is different