File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed
setup-chrome-headless-shell Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1717 env :
1818 CHROME_VERSION : ${{ inputs.chrome-version }}
1919 run : |
20- if [ -n "$CHROME_VERSION" ]; then
21- sudo apt-get update
22- sudo apt-get -y install libu2f-udev
23- sudo apt-get -y install dbus
24-
20+ if [ -n "$CHROME_VERSION" ]; then
2521 echo "version to install: $CHROME_VERSION"
2622 CHROME_BIN=`npx @puppeteer/browsers install chrome-headless-shell@$CHROME_VERSION | awk '{print $2}'`
2723 chmod +x $CHROME_BIN
Original file line number Diff line number Diff line change 99 chrome-version :
1010 description : Chrome version to install
1111 default : " latest"
12+ runner-type :
13+ description : Runner type, 'github-hosted' of 'self-hosted'
14+ default : " self-hosted"
1215
1316runs :
1417 using : composite
@@ -27,10 +30,14 @@ runs:
2730 shell : bash
2831 env :
2932 CHROME_VERSION : ${{ inputs.chrome-version }}
33+ RUNNER_TYPE : ${{ inputs.runner-type }}
3034 run : |
31- if [ -n "$CHROME_VERSION" ]; then
32- sudo apt-get update
33- sudo apt-get -y install libu2f-udev
35+ CURRENT_CHROME_VERSION=$(google-chrome-stable --product-version)
36+ if [[ -n "$CHROME_VERSION" && "$CURRENT_CHROME_VERSION" != "$CHROME_VERSION" ]]; then
37+ if [ "$RUNNER_TYPE" = "github_hosted" ]; then
38+ sudo apt-get update
39+ sudo apt-get -y install libu2f-udev
40+ fi
3441 curl -L "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" > /tmp/chrome.deb
3542 sudo dpkg -i /tmp/chrome.deb
3643 unlink /tmp/chrome.deb
Original file line number Diff line number Diff line change 8383 uses : ./.github/actions/setup-chrome
8484 with :
8585 chrome-version : ' 133.0.6943.53'
86+ runner-type : ' github-hosted'
8687
8788 - name : Use Node.js
8889 uses : actions/setup-node@v4
Original file line number Diff line number Diff line change @@ -423,6 +423,7 @@ jobs:
423423 uses : ./.github/actions/setup-chrome
424424 with :
425425 chrome-version : ' 133.0.6943.53'
426+ runner-type : ' github-hosted'
426427
427428 - name : Use Node.js
428429 uses : actions/setup-node@v4
You can’t perform that action at this time.
0 commit comments