browser-tools-orb icon indicating copy to clipboard operation
browser-tools-orb copied to clipboard

Unable to set `chrome-version` to an env variable in 1.4.1

Open danielrozenberg opened this issue 1 year ago • 2 comments

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?

danielrozenberg avatar Apr 20 '23 18:04 danielrozenberg

I think this is the same as the issue I'm having: https://github.com/CircleCI-Public/browser-tools-orb/issues/69

svobom57 avatar May 16 '23 15:05 svobom57

I am having the same issue described here.

matthewhively avatar Jul 19 '23 01:07 matthewhively