fix: Replace bash-specific regex with POSIX-compliant shell syntax
Some checks failed
Comprehensive CI/CD Pipeline / Build and Test (push) Failing after 4m13s
Comprehensive CI/CD Pipeline / Security Audit (push) Failing after 6s
Comprehensive CI/CD Pipeline / Package Validation (push) Successful in 3m31s
Comprehensive CI/CD Pipeline / Status Report (push) Has been skipped

- Replace [[ =~ ]] regex pattern with grep + sed for compatibility
- Remove bash-specific BASH_REMATCH array usage
- Use POSIX-compliant shell commands for package renaming
- Fix syntax error that was causing CI workflow to fail
- Clean up trailing spaces for yamllint compliance

Resolves shell syntax error in CI workflow package renaming logic.
This commit is contained in:
joe 2025-08-15 15:39:07 -07:00
parent d081296006
commit 52a911eede

View file

@ -162,18 +162,16 @@ jobs:
if ls ../*.deb >/dev/null 2>&1; then
echo "✅ Debian package created successfully"
ls -la ../*.deb
# Rename packages with build version to ensure uniqueness
echo "Renaming packages with build version..."
for pkg in ../*.deb; do
pkg_name=$(basename "$pkg")
pkg_ext="${pkg_name##*.}"
pkg_base="${pkg_name%.*}"
# Extract current version and replace with build version
if [[ "$pkg_name" =~ ^apt-ostree_([^-]+)_([^.]+)\.deb$ ]]; then
current_version="${BASH_REMATCH[1]}"
arch="${BASH_REMATCH[2]}"
# Extract current version and replace with build version using sed
if echo "$pkg_name" | grep -q "^apt-ostree_.*_.*\.deb$"; then
# Extract architecture (last part before .deb)
arch=$(echo "$pkg_name" | sed 's/.*_\([^.]*\)\.deb$/\1/')
new_name="apt-ostree_${BUILD_VERSION}_${arch}.deb"
echo "Renaming: $pkg_name -> $new_name"
cp "$pkg" "$new_name"
@ -182,7 +180,7 @@ jobs:
cp "$pkg" .
fi
done
echo "✅ Packages renamed and copied to current directory"
ls -la *.deb
else