Skip to content

Update analyze.py

Update analyze.py #5

name: Update Portfolio Analysis
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
workflow_dispatch:
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
- name: Run analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python analyze.py
- name: Commit and push if changed
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Update portfolio analysis" && git push)