Refactor update workflow to replace manual git clone with actions/checkout and streamline steps

This commit is contained in:
2026-02-27 22:35:14 +00:00
parent 6f32fec840
commit 597ff34a96

View File

@@ -1,23 +1,27 @@
name: Update Profile Stats name: Update Profile Stats
on: on:
schedule: schedule:
- cron: '0 * * * *' # Runs every hour - cron: '0 * * * *'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest # This now points to the 'catthehacker' image
container:
image: python:3.9-slim
steps: steps:
- name: Manual Git Clone - name: Checkout Code
run: | uses: actions/checkout@v4
# We have to install git first because the runner doesn't even have that!
sudo apt-get update && sudo apt-get install -y git python3 python3-pip
git clone http://your-gitea-ip:3000/${{ gitea.repository }}.git .
- name: Run Script - name: Install Requirements
run: | run: pip3 install requests --break-system-packages
pip3 install requests --break-system-packages
python3 update_profile.py - name: Run Update Script
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: python3 update_profile.py
- name: Commit and Push
run: |
git config --local user.email "action@gitea.com"
git config --local user.name "Gitea Action"
git add README.md
git diff --quiet && git diff --staged --quiet || (git commit -m "Update profile stats" && git push)