Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set chrome-version to an env variable in 1.4.1 #70

Open
danielrozenberg opened this issue Apr 20, 2023 · 2 comments · May be fixed by #72
Open

Unable to set chrome-version to an env variable in 1.4.1 #70

danielrozenberg opened this issue Apr 20, 2023 · 2 comments · May be fixed by #72
Assignees

Comments

@danielrozenberg
Copy link

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}.

ORB_PARAM_CHROME_VERSION: <<parameters.chrome-version>>

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 added a commit to ampproject/amphtml that referenced this issue Apr 25, 2023
* Update CircleCI Orbs versions

* Explicitly set `ORB_PARAM_CHROME_VERSION` env variable in shell script
(workaround for CircleCI-Public/browser-tools-orb#70)
@svobom57
Copy link

I think this is the same as the issue I'm having:
#69

@ryanbourdais ryanbourdais self-assigned this Jun 21, 2023
@ryanbourdais ryanbourdais linked a pull request Jun 21, 2023 that will close this issue
@matthewhively
Copy link

I am having the same issue described here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants