-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (49 loc) · 1.63 KB
/
Copy pathconsolidate-data.yml
File metadata and controls
57 lines (49 loc) · 1.63 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Consolidate Bitcoin Data
on:
push:
paths:
- 'btc_ohclv_*.csv' # Se déclenche seulement pour les fichiers daily
branches:
- main # Changez si votre branche principale a un autre nom
jobs:
consolidate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
pip install pandas
- name: Run consolidation script
run: |
python consolidate_bitcoin_data.py
- name: Check for changes
id: verify-changed-files
run: |
if git diff --quiet btc-hourly-price_2015_2025.csv; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Delete btc_ohclv_* files
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
# Remove all btc_ohclv_* files
rm -f btc_ohclv_*.csv
echo "Deleted btc_ohclv_* files"
- name: Commit and push updated file
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add btc-hourly-price_2015_2025.csv
git add -u # This stages deleted files
git commit -m "Auto-update consolidated Bitcoin data and cleanup daily files"
git push