fixing workflow

This commit is contained in:
2026-03-11 14:54:06 +00:00
parent cd5a10362b
commit fe8afcecc4

View File

@@ -3,37 +3,45 @@ name: Update Arch Repository
on: on:
push: push:
paths: paths:
- 'x86_64/*.pkg.tar.zst' # Only runs when you add a new package file - 'x86_64/*.pkg.tar.zst'
workflow_dispatch: # Allows you to run it manually workflow_dispatch:
jobs: jobs:
update-db: update-db:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: archlinux:latest # Runs inside an actual Arch Linux environment container:
image: archlinux:latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history so push works better
- name: Install Dependencies
run: |
pacman -Sy --noconfirm pacman git # Added 'git' here
- name: Update Repository Database - name: Update Repository Database
run: | run: |
# Install necessary tools
pacman -Sy --noconfirm pacman
cd x86_64 cd x86_64
echo "Adding packages to database..." # Update the database
repo-add hyprarch-repo.db.tar.gz *.pkg.tar.zst repo-add hyprarch-repo.db.tar.gz *.pkg.tar.zst
echo "Fixing symlinks for GitHub Pages..." # Force break symlinks for GitHub Pages compatibility
rm -f hyprarch-repo.db hyprarch-repo.files rm -f hyprarch-repo.db hyprarch-repo.files
cp hyprarch-repo.db.tar.gz hyprarch-repo.db cp hyprarch-repo.db.tar.gz hyprarch-repo.db
cp hyprarch-repo.files.tar.gz hyprarch-repo.files cp hyprarch-repo.files.tar.gz hyprarch-repo.files
- name: Commit and Push changes - name: Commit and Push changes
run: | run: |
git config --global --add safe.directory /github/workspace # This line fixes the 'dubious ownership' error in containers
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add x86_64/ git add x86_64/
git commit -m "Automated database update" || echo "No changes to commit" # Only commit if there are actually changes to the .db files
git diff-index --quiet HEAD || git commit -m "Automated database update"
git push git push