-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTest-dataCollectionWorkflow.yml
More file actions
42 lines (34 loc) · 1.26 KB
/
Test-dataCollectionWorkflow.yml
File metadata and controls
42 lines (34 loc) · 1.26 KB
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
name: Test Data Collection
#use for formating for further workflows
on:
schedule:
- cron: '0 0 1,15 * *' # Runs at midnight on the 1st and 15th
workflow_dispatch: # Allows to run manually for testing
jobs:
run-python-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install PyGithub pandas python-dotenv
- name: Run Python script
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
cd Backend
python -m dataCollection.collectData
- name: Commit and Push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Create and switch to the data/Automated_Updates branch
git checkout -b data/Automated_Updates
git add Backend/test_data.json
git commit -m "Automated data collection: Update test_data.json" || echo "No changes to commit"
git push origin data/Automated_Updates --force