Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/remote/test/puppeteer/tools/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  build_daily_comment.mjs   Sprache: unbekannt

 
/**
 * @license
 * Copyright 2024 Google Inc.
 * SPDX-License-Identifier: Apache-2.0
 */
import actions from '@actions/core';

/**
 *
 * @param {string} env
 * @returns {string}
 */
function getGitHubEnvVariable(env) {
  return process.env[`GITHUB_${env.toUpperCase()}`];
}

function getStatus(result) {
  if (result === 'success') {
    return '✅ Tests succeeded';
  }

  return '❌ Tests failed';
}

const options = {
  year: 'numeric',
  month: 'numeric',
  day: 'numeric',
};
const today = new Date().toLocaleDateString('en-GB', options);

const chromeStatus = getStatus(process.env.CHROME_RUN_STATUS);
const firefoxStatus = getStatus(process.env.FIREFOX_RUN_STATUS);
const body = `
Date: ${today}

| Browser | Status | 
| ------- | ------ | 
| Chrome Canary | ${chromeStatus} |
| Firefox Nightly | ${firefoxStatus} |
`;

const footer = `
---
[Link](${getGitHubEnvVariable('server_url')}/${getGitHubEnvVariable('repository')}/actions/runs/${getGitHubEnvVariable('run_id')})`;

actions.setOutput('today', today);
actions.setOutput('body', `${body}${footer}`);

[ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet)  ]