Files
maigret/.github/workflows/update-site-data.yml
T
2026-04-08 00:48:36 +02:00

40 lines
1.2 KiB
YAML

name: Update sites rating and statistics
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2.3.2
with:
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: build application
run: |
pip3 install .
python3 ./utils/update_site_data.py --empty-only
- name: Check for meaningful changes
id: check
run: |
REAL_CHANGES=$(git diff --unified=0 sites.md | grep '^[+-][^+-]' | grep -v 'The list was updated at' | wc -l)
if [ "$REAL_CHANGES" -gt 0 ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Updated site list and statistics"
title: "Automated Sites List Update"
body: "Automated changes to sites.md based on new Alexa rankings/statistics."
branch: "auto/update-sites-list"
delete-branch: true