Skip to content

Commit

Permalink
fix(constants): skip Puppeteer Chromium download as asked
Browse files Browse the repository at this point in the history
- always skip download in GitHub Actions runtime
- specify PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 to skip locally
  • Loading branch information
sidvishnoi committed Jun 11, 2021
1 parent f5857f0 commit cfa5aed
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import * as path from "path";

export const ACTION_DIR = path.join(__dirname, "..");

export const PUPPETEER_ENV = {
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "1",
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome",
};
export const PUPPETEER_ENV = (() => {
const skipChromeDownload =
!!process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD ||
!!process.env.GITHUB_ACTIONS;
if (!skipChromeDownload) return {};
return {
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "1",
PUPPETEER_EXECUTABLE_PATH:
process.env.PUPPETEER_EXECUTABLE_PATH || "/usr/bin/google-chrome",
};
})();

0 comments on commit cfa5aed

Please sign in to comment.