How to use the @lhci/utils/src/build-context.js.getGitHubRepoSlug function in @lhci/utils

To help you get started, we’ve selected a few @lhci/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChrome / lighthouse-ci / packages / cli / src / healthcheck / healthcheck.js View on Github external
    shouldTest: opts => !!getGitHubRepoSlug() && (!!opts.target || !!opts.serverBaseUrl),
    test: opts => Boolean(opts.githubToken || opts.githubAppToken),
github GoogleChrome / lighthouse-ci / packages / cli / src / upload / upload.js View on Github external
async function runGithubStatusCheck(options, targetUrlMap) {
  const hash = getCurrentHash();
  const slug = getGitHubRepoSlug();
  const {githubToken, githubAppToken} = options;

  if (!githubToken && !githubAppToken) return print('No GitHub token set, skipping.\n');
  print('GitHub token found, attempting to set status...\n');
  if (!slug) return print(`No GitHub remote found, skipping.\n`);
  if (!slug.includes('/')) return print(`Invalid repo slug "${slug}", skipping.\n`);
  if (!hash) return print(`Invalid hash "${hash}"\n, skipping.`);

  const assertionResults = loadAssertionResults();
  const groupedResults = _.groupBy(assertionResults, result => result.url).sort(
    (a, b) => a[0].url.length - b[0].url.length
  );

  if (groupedResults.length) {
    for (const group of groupedResults) {
      const rawUrl = group[0].url;