yay/.gitea/workflows/bump-pkgrel.sh
Sebastiaan de Schaetzen 2748fdf24b
All checks were successful
Workflows / Update from AUR (push) Successful in 8s
Workflows / Wake Runner (push) Successful in 10s
Workflows / Check if rebuild is necessary (push) Has been skipped
Workflows / Build and Push (push) Has been skipped
Attempt to run every two minutes
2025-04-23 12:21:56 +02:00

25 lines
639 B
Bash
Executable File

#!/bin/bash
# Run your check script
.gitea/workflows/check-up-to-date.sh
RETVAL=$?
if [ $RETVAL -eq 1 ]; then
echo "Changes detected, bumping pkgrel..."
# Use sed to increment pkgrel in the PKGBUILD file
sed -i -E 's/^(pkgrel=)([0-9]+)/echo "\1$((\2 + 1))"/e' PKGBUILD
# Get the new pkgrel value for the commit message
NEW_PKGREL=$(grep ^pkgrel= PKGBUILD | cut -d= -f2)
# Add, commit, and push the change
git add PKGBUILD
git commit -m "Bump pkgrel to ${NEW_PKGREL}"
git push
echo "pkgrel bumped to ${NEW_PKGREL} and changes pushed."
else
echo "No changes detected. Nothing to do."
fi