Skip to content

Update update_foops_badge.yml #3

Update update_foops_badge.yml

Update update_foops_badge.yml #3

name: Update FOOPS Score Badge
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
push:
branches:
- master
workflow_dispatch:
env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "[email protected]"
jobs:
update-badge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Fetch FOOPS score and update badge
run: |
python docs/scripts/generate_foops_badge.py
- name: Commit changes
run: |
git config --local user.email "${{ env.GIT_USER_EMAIL }}"
git config --local user.name "${{ env.GIT_USER_NAME }}"
git add README.md
git diff --staged --quiet || git commit -m "Update FOOPS score badge"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
run: git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}