How to use the @actions/core.getInput 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 ReactiveCircus / android-emulator-runner / src / main.ts View on Github external
checkApiLevel(apiLevelInput);
    const apiLevel = Number(apiLevelInput);
    console.log(`API level: ${apiLevel}`);

    // target of the system image
    const target = core.getInput('target');
    checkTarget(target);
    console.log(`target: ${target}`);

    // CPU architecture of the system image
    const arch = core.getInput('arch');
    checkArch(arch);
    console.log(`CPU architecture: ${arch}`);

    // Hardware profile used for creating the AVD
    const profile = core.getInput('profile');
    console.log(`Hardware profile: ${profile}`);

    // emulator options
    const emulatorOptions = core.getInput('emulator-options').trim();
    console.log(`emulator options: ${emulatorOptions}`);

    // disable animations
    const disableAnimationsInput = core.getInput('disable-animations');
    checkDisableAnimations(disableAnimationsInput);
    const disableAnimations = disableAnimationsInput === 'true';
    console.log(`disable animations: ${disableAnimations}`);

    // custom script to run
    const scriptInput = core.getInput('script', { required: true });
    const scripts = parseScript(scriptInput);
    console.log(`Script:`);
github TryGhost / action-deploy-theme / index.js View on Github external
(async function main() {
    try {
        const url = core.getInput('api-url');
        const api = new GhostAdminApi({
            url,
            key: core.getInput('api-key'),
            version: 'canary'
        });

        const basePath = process.env.GITHUB_WORKSPACE;
        const pkgPath = path.join(process.env.GITHUB_WORKSPACE, 'package.json');
        const themeName = core.getInput('theme-name') || require(pkgPath).name;
        const themeZip = `${themeName}.zip`;
        const zipPath = path.join(basePath, themeZip);
        const exclude = core.getInput('exclude') || '';

        // Create a zip
        await exec.exec(`zip -r ${themeZip} . -x *.git* *.zip yarn* npm* *routes.yaml *redirects.yaml *redirects.json ${exclude}`, [], {cwd: basePath});

        // Deploy it to the configured site
        await api.themes.upload({file: zipPath});
        console.log(`${themeZip} successfully uploaded.`);
github newrelic / newrelic-ruby-agent / .github / actions / build-ruby / index.js View on Github external
async function main() {
  const dependencyList = core.getInput('dependencies')
  const rubyVersion = core.getInput('ruby-version')

  try {
    // restores from cache if this ruby version was previously built and cached
    await restoreRubyFromCache(rubyVersion)

    // skip setting up environment when we're only building and Ruby's already built!
    if (isRubyBuilt(rubyVersion) && isBuildJob()) { return }

    await setupEnvironment(rubyVersion, dependencyList)
    await setupRuby(rubyVersion)
    await setupTestEnvironment(rubyVersion)
  } 
  catch (error) {
    core.setFailed(`Action failed with error ${error}`)
  }
github peter-evans / create-pull-request / index.js View on Github external
// Setup Python from the tool cache
    setupPython("3.8.0", "x64");

    // Install requirements
    await exec.exec("pip", [
      "install",
      "--requirement",
      `${src}/requirements.txt`
    ]);

    // Fetch action inputs
    const inputs = {
      token: core.getInput("token"),
      commitMessage: core.getInput("commit-message"),
      commitAuthorName: core.getInput("author-name"),
      commitAuthorEmail: core.getInput("author-email"),
      committerName: core.getInput("committer-name"),
      committerEmail: core.getInput("committer-email"),
      title: core.getInput("title"),
      body: core.getInput("body"),
      labels: core.getInput("labels"),
      assignees: core.getInput("assignees"),
      reviewers: core.getInput("reviewers"),
      teamReviewers: core.getInput("team-reviewers"),
      milestone: core.getInput("milestone"),
      project: core.getInput("project"),
      projectColumn: core.getInput("project-column"),
      branch: core.getInput("branch"),
      base: core.getInput("base"),
      branchSuffix: core.getInput("branch-suffix"),
      debugEvent: core.getInput("debug-event")
    };
github hecrj / setup-rust-action / src / main.ts View on Github external
async function run() {
  try {
    const version = core.getInput('rust-version');

    const components = core.getInput('components')
      .split(',')
      .map((component) => component.trim())
      .filter((component) => component.length > 0);

    const targets = core.getInput('targets')
      .split(',')
      .map((target) => target.trim())
      .filter((target) => target.length > 0);

    if(version) {
      await rustup.install();

      await exec.exec(
        'rustup',
github Azure / dev-spaces / actions / add-review-url-ts / src / AddReviewUrl.ts View on Github external
private async addCommentUsingSubjectId(pullRequestId: GraphQlQueryResponseData, comment: string) {
        console.log(`pullRequestId  ===>>>> ${pullRequestId}`)
        let data = JSON.parse(JSON.stringify(pullRequestId));
        console.log(`Parsed pull request id ${data}`)
        const token = core.getInput('repo-token');
        let graphQlResponse = graphql(this.addPullRequestCommentMutation(), {
                headers: {
                    authorization: `token ${token}`,
                },
                subjectId: data.repository.pullRequest.id,
                body: comment,

            },
        );
        console.log(`Adding the comment ...`);
        return await graphQlResponse;
    }
github cycjimmy / semantic-release-action / src / handleOptions.js View on Github external
exports.handleBranchOption = () => {
  const branchOption = {};
  const branch = core.getInput(inputs.branch);

  if (branch) {
    branchOption.branch = branch;
  }

  return branchOption;
};
github newrelic / newrelic-ruby-agent / .github / actions / ruby-build-action / src / index.js View on Github external
async function run() {
  try {
    await _installRubyBuild()

    const rubyVersion = core.getInput('ruby-version');
    const cacheAvailable = core.getInput('cache-available') == 'true'
    await _installRuby(rubyVersion, cacheAvailable)
  }
  catch (error) {
    core.setFailed(error.message);
  }
}
github trmcnvn / firefox-addon / src / main.ts View on Github external
async function run() {
  try {
    const uuid = core.getInput('uuid');
    const path = core.getInput('xpi', { required: true });
    const manifest = core.getInput('manifest', { required: true });
    const key = core.getInput('api-key', { required: true });
    const secret = core.getInput('api-secret', { required: true });

    const token = generateJWT(key, secret);
    await sendRequest(uuid, path, manifest, token);
  } catch (error) {
    core.setFailed(error.message);
  }
}
github newrelic / newrelic-ruby-agent / .github / actions / ruby-build-action / src / index.js View on Github external
async function run() {
  try {
    await _installRubyBuild()

    const rubyVersion = core.getInput('ruby-version');
    const cacheAvailable = core.getInput('cache-available') == 'true'
    await _installRuby(rubyVersion, cacheAvailable)
  }
  catch (error) {
    core.setFailed(error.message);
  }
}