Storage bucket names must be globally unique. Two deployments in the same project need to have different prefixes thus we will not see the conflict, but deployments in different projects can use the same prefix triggering conflict on the bucket name.
Suggested solution would be to:
- generate random suffix
- add it to the bucket name
- pass bucket name as variable to function
- modify function top accept it.