From 9f891b611d50d10f444335f2ae4049266a55eecf Mon Sep 17 00:00:00 2001 From: Mitsuba100 <82495539+Mitsuba100@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:21:36 +0100 Subject: [PATCH] Refactor update-repo.yml for container and Git config --- .github/workflows/update-repo.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update-repo.yml b/.github/workflows/update-repo.yml index 9f99c99..08a2416 100644 --- a/.github/workflows/update-repo.yml +++ b/.github/workflows/update-repo.yml @@ -9,7 +9,9 @@ on: jobs: update-db: runs-on: ubuntu-latest - container: archlinux:latest + container: + image: archlinux:latest + options: --user root # Ensure we are running as root to match container ownership steps: - name: Checkout code @@ -21,30 +23,29 @@ jobs: run: | pacman -Sy --noconfirm pacman git + - name: Fix Git Ownership + run: | + # This tells Git to ignore ownership checks for every folder on this runner + git config --global --add safe.directory '*' + - name: Update Repository Database run: | - # Use the environment variable to trust the directory - git config --global --add safe.directory "$GITHUB_WORKSPACE" - cd x86_64 if ls *.pkg.tar.zst 1> /dev/null 2>&1; then echo "Updating database..." repo-add hyprarch-repo.db.tar.gz *.pkg.tar.zst - # Break symlinks for GitHub Pages compatibility + # Break symlinks for GitHub Pages rm -f hyprarch-repo.db hyprarch-repo.files cp hyprarch-repo.db.tar.gz hyprarch-repo.db cp hyprarch-repo.files.tar.gz hyprarch-repo.files else - echo "No packages found in x86_64/." + echo "No packages found." exit 1 fi - name: Commit and Push changes run: | - # Re-verify safe directory for this specific shell step - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com"