fixing workflow 2
This commit is contained in:
15
.github/workflows/update-repo.yml
vendored
15
.github/workflows/update-repo.yml
vendored
@@ -10,28 +10,29 @@ jobs:
|
|||||||
update-db:
|
update-db:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: archlinux:latest
|
container: archlinux:latest
|
||||||
|
# This ensures the container knows exactly where the workspace is
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: /__w/hyprarch-repo/hyprarch-repo
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Step 1: Actually download the code so it IS a git repo
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# Step 2: Install tools
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
pacman -Sy --noconfirm pacman git
|
pacman -Sy --noconfirm pacman git
|
||||||
|
|
||||||
# Step 3: Run the database update
|
|
||||||
- name: Update Repository Database
|
- name: Update Repository Database
|
||||||
run: |
|
run: |
|
||||||
# Tell git to trust the directory immediately
|
# Explicitly trust the directory for the bot user
|
||||||
git config --global --add safe.directory /__w/hyprarch-repo/hyprarch-repo
|
git config --global --add safe.directory /__w/hyprarch-repo/hyprarch-repo
|
||||||
|
|
||||||
cd x86_64
|
cd x86_64
|
||||||
if ls *.pkg.tar.zst 1> /dev/null 2>&1; then
|
if ls *.pkg.tar.zst 1> /dev/null 2>&1; then
|
||||||
echo "Packages found. Updating database..."
|
echo "Updating database..."
|
||||||
repo-add hyprarch-repo.db.tar.gz *.pkg.tar.zst
|
repo-add hyprarch-repo.db.tar.gz *.pkg.tar.zst
|
||||||
|
|
||||||
# Break symlinks for GitHub Pages
|
# Break symlinks for GitHub Pages
|
||||||
@@ -39,11 +40,9 @@ jobs:
|
|||||||
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
|
||||||
else
|
else
|
||||||
echo "No .pkg.tar.zst files found."
|
echo "No packages found."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 4: Push back to the repo
|
|
||||||
- name: Commit and Push changes
|
- name: Commit and Push changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
|
|||||||
Reference in New Issue
Block a user