-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.52 KB
/
update-portfolio.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
53
name: Update Portfolio Analysis
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
paths-ignore: # Ignore les changements sur ces fichiers
- 'PORTFOLIO.md'
- 'github_portfolio.json'
workflow_dispatch:
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Check directory structure
run: |
echo "Current directory:"
pwd
echo "Directory content:"
ls -R
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt --no-cache-dir
python -m pip list
- name: Run analysis
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
PYTHONPATH=$PYTHONPATH:$(pwd) python analyze.py
- name: Commit and push if changed
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Update portfolio analysis [skip ci]" && git push)