w9jds / firebase-action

GitHub Action for interacting with Firebase
MIT License
922 stars 198 forks source link

Possible escaping / quoting issue in entrypoint.sh #169

Open ostollmann opened 1 year ago

ostollmann commented 1 year ago

The following fails silently:

~/Repos/mwl2/ dev* > docker run --workdir /home --rm -v `pwd`:"/home" -it -e FIREBASE_TOKEN -e DEBUG=1 w9jds/firebase-action:v11.16.0 appdistribution:distribute --app ***** --release-notes "Features and/or bug fixes" --groups "actyx" --debug app-release-unsigned.apk
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

The following works:

~/Repos/mwl2/ dev* > docker run --workdir /home --rm -v `pwd`:"/home" -it -e FIREBASE_TOKEN -e DEBUG=1 w9jds/firebase-action:v11.16.0 'appdistribution:distribute --app ***** --release-notes "Features and/or bug fixes" --groups "actyx" --debug app-release-unsigned.apk'

In the second call I wrap all my arguments in single quotes.

Could this be a problem with sh -c "firebase $*" from /entrypoint.sh?

Note: I am running the docker image myself for debugging purposes. The same problem happens when running on Github.

w9jds commented 1 year ago

No this is mostly likely just how GitHub handles passing information into their action infrastructure. These containers can be run locally, but my guess is that it's not standard as it supports both docker and JS/TS actions. I would recommend looking at how it runs when GitHub runs it in their system to get a good idea on how to replicate it.