Pngquant cannot open png files for reading

Hello I have the problem that pngquant installed and executed by a bash script ends with the error error: cannot open **/*.png for reading although everything works locally.

Here is a link to the latest pipeline optimizing (#883708849) · Jobs · Independent-Eye / SuperTuxParty · GitLab.

gitlab-ci.yml file section that starts the bash script:
optimizing:
image: ubuntu:latest
stage: build_and_test
script:
- chmod +x optimization.sh
- ./optimization.sh

bash script :
#!/usr/bin/env bash

#Light-Green='\033[1;32m'
#Cyan='\033[1;36m'

printf "\033[1;36mInstaling and Updating\033[0m\n"
apt-get update
printf "\033[1;32mRepository cache updated\033[0m\n"
apt-get -y install pngquant
printf "\033[1;32mpngquant installed\033[0m\n"
pngquant  **/*.png --skip-if-larger --ext=.png --force

Edit: Link to bash script optimization.sh · automation · Independent-Eye / SuperTuxParty · GitLab

Link to gitlab-ci.yml file .gitlab-ci.yml · automation · Independent-Eye / SuperTuxParty · GitLab

Hi @Independent-Eye2446, welcome to the GitLab Community forums!

It looks like a problem with bash globbing not finding any .png files in */*.

Luckily, I believe there’s an easy fix. Can you change the following line in your optimization.sh script and try again?

-- pngquant  **/*.png --skip-if-larger --ext=.png --force
++ find . -name '*.png' -exec pngquant --ext .png --force 256 {} \;

Let us know how it goes!

P.S. I did not know about SuperTuxParty before now, that game looks like really fun. Thanks for the links and for your contribution!

Hello @ gitlab-greg I saw that you have already made a pull request on SuperTuxParty and thank you for your contribution.

To be transparent, my MR was an accident. I meant to test out my suggestion before I shared it with you here in the forum, but I left the “create a new MR” box checked.

@Independent-Eye2446 Can you create a new MR yourself to make sure you get credit for your work?