Skip to content

workflow update

workflow update #9

Workflow file for this run

name: Update README Download Badge
on:
schedule:
- cron: "0 11 * * *" # 6 AM EST = 11 AM UTC
workflow_dispatch:
push:
paths:
- .github/workflows/update-readme.yml
- readme.py
- README.template.md
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Jinja2
run: pip install Jinja2 requests git+https://github.com/michaelthomasletts/pepy-chart.git
- name: Render README with PePy stats
run: python3 readme.py
- name: Update download stats
run: |
pepy-chart -p boto3-refresh-session -op doc/downloads.png
- name: Commit and push if README and/or downloads.png changed
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if ! git diff --cached --quiet; then
git commit -m "Updating README.md [skip release]"
git pull https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git main --rebase
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git HEAD:main
else
echo "No changes to commit"
fi