browser-tools-orb
browser-tools-orb copied to clipboard
Unable to set `chrome-version` to an env variable in 1.4.1
Orb version
1.4.1
What happened
I'm trying to upgrade the version of this orb in my config file from 1.2.3 to 1.4.1. Prior to the update my config had these lines:
steps:
- run:
name: 'Get Pinned Chrome Version'
command: ./.circleci/get_pinned_chrome_version.sh
- browser-tools/install-chrome:
chrome-version: ${CHROME_VERSION}
replace-existing: true
The shell script determined which version of Chrome is pinned to various package.lock
files and export it to the CHROME_VERSION
env variable using echo "export CHROME_VERSION=$CHROME_VERSION" >> $BASH_ENV
When I change the orb version to 1.4.1 I get the following error log:
Google Chrome is not currently installed; installing it
Preparing Chrome installation for Debian-based systems
https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_$%7BCHROME_VERSION%7D-1_amd64.deb:
2023-04-20 16:27:49 ERROR 404: Not Found.
/bin/bash: line 130: google-chrome-stable: command not found
Google Chrome v${CHROME_VERSION} (stable) failed to install.
It looks this line change in #46 is the cause, because the env variable is now interpreted as a verbatim string ${CHROME_VERSION}
.
https://github.com/CircleCI-Public/browser-tools-orb/blob/a15ea927488578a5b7c65fbad7deb4729d05ca24/src/commands/install-chrome.yml#L28
As a workaround I modified the export statement to echo "export ORB_PARAM_CHROME_VERSION=$CHROME_VERSION" >> $BASH_ENV
and removed the chrome-version: ${CHROME_VERSION}
from the config file.
Expected behavior
Not sure! Is there a way to pass a dynamically determined version to this orb without a sad hack?
I think this is the same as the issue I'm having: https://github.com/CircleCI-Public/browser-tools-orb/issues/69
I am having the same issue described here.