How to use the @actions/core.warning function in @actions/core

To help you get started, we’ve selected a few @actions/core 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 treosh / lighthouse-ci-action / src / input.js View on Github external
}
  }

  // Get and interpolate URLs
  const urls = interpolateProcessIntoURLs(getList('urls'))

  // Make sure we have either urls or a static-dist-dir
  if (!urls && !staticDistDir) {
    // Fail and exit
    core.setFailed(`Need either 'urls' in action parameters or a 'static_dist_dir' in lighthouserc file`)
    process.exit(1)
  }

  // Warn if specifying both
  if (urls.length > 0 && staticDistDir) {
    core.warning(
      `Setting both 'url' and 'static_dist_dir' will ignore urls in 'url' since 'static_dist_dir' has higher priority`
    )
  }

  return {
    urls,
    staticDistDir,
    canUpload: getArg('temporaryPublicStorage') ? true : false,
    budgetPath: getArg('budgetPath'),
    numberOfRuns: getIntArg('runs'),
    serverBaseUrl,
    token,
    rcCollect,
    rcAssert,
    configPath
  }
github Azure / appservice-actions / webapp-container / src / main.ts View on Github external
}
    finally {
        if(!!kuduServiceUtility) {
            await addAnnotation(taskParams.endpoint, appService, isDeploymentSuccess);
            let activeDeploymentID = await kuduServiceUtility.updateDeploymentStatus(isDeploymentSuccess, null, {'type': 'Deployment', slotName: appService.getSlot()});
            core.debug('Active DeploymentId :'+ activeDeploymentID);
        }
        
        let appServiceApplicationUrl: string = await appServiceUtility.getApplicationURL();
        console.log('App Service Application URL: ' + appServiceApplicationUrl);
        core.setOutput('webapp-url', appServiceApplicationUrl);
        
        // Reset AZURE_HTTP_USER_AGENT
        core.exportVariable('AZURE_HTTP_USER_AGENT', prefix);
        core.debug(isDeploymentSuccess ? "Deployment Succeded" : "Deployment failed");
        core.warning('This action is moved to azure/webapps-container-deploy repository, update your workflows to use those actions instead.');
    }
}
github Azure / k8s-actions / docker-logout / src / logout.ts View on Github external
function run() {
    core.warning('This action is moved to azure/containers-actions repository, update your workflows to use those actions instead.');
    let pathToDockerConfig = process.env['DOCKER_CONFIG'];
    if (pathToDockerConfig && ioUtil.exists(pathToDockerConfig)) {
        io.rmRF(pathToDockerConfig); // Deleting the docker config directory
        core.debug(`${pathToDockerConfig} has been successfully deleted`);
    };
    issueCommand('set-env', { name: 'DOCKER_CONFIG' }, '');
    console.log('DOCKER_CONFIG environment variable unset');
}
github Azure / k8s-deploy / src / utilities / manifest-stability-utility.ts View on Github external
async function waitForServiceExternalIPAssignment(kubectl: Kubectl, serviceName: string): Promise {
    const sleepTimeout = 10 * 1000; // 10 seconds
    const iterations = 18; // 18 * 10 seconds timeout = 3 minutes max timeout

    for (let i = 0; i < iterations; i++) {
        console.log(`waitForServiceIpAssignment : ${serviceName}`);
        await utils.sleep(sleepTimeout);
        let status = (getService(kubectl, serviceName)).status;
        if (isLoadBalancerIPAssigned(status)) {
            console.log('ServiceExternalIP', serviceName, status.loadBalancer.ingress[0].ip);
            return;
        }
    }
    core.warning(`waitForServiceIpAssignmentTimedOut ${serviceName}`);
}
github Azure / k8s-actions / docker-login / src / login.ts View on Github external
async function run() {
    core.warning('This action is moved to azure/containers-actions repository, update your workflows to use those actions instead.');
    let username = core.getInput('username', { required: true });
    let password = core.getInput('password', { required: true });
    let loginServer = core.getInput('login-server', { required: true });
    let authenticationToken = new Buffer(`${username}:${password}`).toString('base64');

    let config = {
        "auths": {
            [loginServer]: {
                auth: authenticationToken
            }
        }
    }

    const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
    const dirPath = path.join(runnerTempDirectory, `docker_login_${Date.now()}`);
    await io.mkdirP(dirPath);
github anton-yurchenko / git-release / wrapper.js View on Github external
function main () {
  if (os.arch() !== 'x64') {
    core.setFailed(`[wrapper] runner cpu architecture is not supported: '${os.arch}'`)
    process.exit(1)
  }

  let filename

  if (process.platform === 'win32') {
    filename = 'git-release-windows-amd64.exe'
  } else if (process.platform === 'linux') {
    core.warning('Executing this action via wrapper is not recommended on Linux runner!')
    filename = 'git-release-linux-amd64'
  } else {
    core.setFailed(`[wrapper] runner operation system is not supported: '${process.platform}'`)
    process.exit(1)
  }

  execute(path.join(__dirname, 'build', filename))
}
github deliverybot / helm / index.js View on Github external
const client = new github.GitHub(token);
    const url = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${context.sha}/checks`;

    await client.repos.createDeploymentStatus({
      ...context.repo,
      deployment_id: deployment.id,
      state,
      log_url: url,
      target_url: url,
      headers: {
        accept: 'application/vnd.github.ant-man-preview+json'
      }
    });
  } catch (error) {
    core.warning(`Failed to set deployment status: ${error.message}`);
  }
}
github Azure / k8s-deploy / lib / utilities / utility.js View on Github external
execResults.forEach(result => {
            if (result.stderr) {
                if (result.code !== 0) {
                    stderr += result.stderr + '\n';
                }
                else {
                    core.warning(result.stderr);
                }
            }
        });
        if (stderr.length > 0) {
github lenskit / lkpy / .github / actions / conda-env / main.js View on Github external
async function fixPerms(cfg) {
    try {
        await writeFile(path.join(conda_dir, 'envs', '.test-path'));
    } catch (e) {
        if (process.platform != 'win32') {
            core.info('changing $CONDA ownership');
            await exec(`sudo chown -R $USER $CONDA`, {shell: true});
        } else {
            core.warning('could not create directory in Conda, this might cause a problem');
        }
    }
}
github actions / cache / src / restore.ts View on Github external
const tarPath = await io.which("tar", true);
            core.debug(`Tar Path: ${tarPath}`);

            await exec(`"${tarPath}"`, args);

            const isExactKeyMatch = utils.isExactKeyMatch(
                primaryKey,
                cacheEntry
            );
            utils.setCacheHitOutput(isExactKeyMatch);

            core.info(
                `Cache restored from key: ${cacheEntry && cacheEntry.cacheKey}`
            );
        } catch (error) {
            core.warning(error.message);
            utils.setCacheHitOutput(false);
        }
    } catch (error) {
        core.setFailed(error.message);
    }
}