Update update_foops_badge.yml #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |