From 597ff34a96f9397d9d079653d30ef1b2c6616aac Mon Sep 17 00:00:00 2001 From: Nathan Falvey Date: Fri, 27 Feb 2026 22:35:14 +0000 Subject: [PATCH] Refactor update workflow to replace manual git clone with actions/checkout and streamline steps --- .gitea/workflows/update.yaml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/update.yaml b/.gitea/workflows/update.yaml index 60e7a28..45ca0fc 100644 --- a/.gitea/workflows/update.yaml +++ b/.gitea/workflows/update.yaml @@ -1,23 +1,27 @@ name: Update Profile Stats - on: schedule: - - cron: '0 * * * *' # Runs every hour - workflow_dispatch: + - cron: '0 * * * *' + workflow_dispatch: jobs: build: - runs-on: ubuntu-latest - container: - image: python:3.9-slim + runs-on: ubuntu-latest # This now points to the 'catthehacker' image steps: - - name: Manual Git Clone - run: | - # 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 - run: | - pip3 install requests --break-system-packages - python3 update_profile.py \ No newline at end of file + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install Requirements + run: pip3 install requests --break-system-packages + + - 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) \ No newline at end of file