Skip to content

Update npm downloads CSV #22

Update npm downloads CSV

Update npm downloads CSV #22

Workflow file for this run

name: Update npm downloads CSV
on:
workflow_dispatch:
jobs:
update-contributors:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Node.js dependencies
run: npm install
- name: Run scripts/graph-downloads.js to generate CSV
run: node scripts/graph-downloads.js
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pandas plotnine
- name: Run Python script to update README
run: python plot-downloads.py
- 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'
git add .
# Only commit if there are staged changes
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m 'Update contributors data and README'
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}