@actions/core#getBooleanInput TypeScript Examples

The following examples show how to use @actions/core#getBooleanInput. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: context.ts    From auto-changelog with MIT License 6 votes vote down vote up
export async function getInputs(): Promise<ActionInputsI> {
  const commitTypes = YAML.parse(getInput("commit-types", { required: true }));
  const defaultCommitType = getInput("default-commit-type", { required: true });
  const releaseName = getInput("release-name", { required: true });
  const mentionAuthors = getBooleanInput("mention-authors", { required: true });
  const mentionNewContributors = getBooleanInput("mention-new-contributors", {
    required: true,
  });
  const includeCompare = getBooleanInput("include-compare", { required: true });
  const semver = getBooleanInput("semver", { required: true });

  return Joi.object<ActionInputsI, true>()
    .keys({
      commitTypes: Joi.object<TypesI>()
        .pattern(Joi.string(), Joi.string())
        .required(),
      defaultCommitType: Joi.string().required(),
      releaseName: Joi.string().required(),
      mentionAuthors: Joi.boolean().required(),
      mentionNewContributors: Joi.boolean().required(),
      includeCompare: Joi.boolean().required(),
      semver: Joi.boolean().required(),
    })
    .validateAsync({
      commitTypes,
      defaultCommitType,
      releaseName,
      mentionAuthors,
      mentionNewContributors,
      includeCompare,
      semver,
    });
}
Example #2
Source File: main.ts    From action-eslint with MIT License 6 votes vote down vote up
run = async ():Promise<void> => {
  try {
    const inputs: Inputs = {
      token: getInput('github-token', { required: true }),
      annotations: getBooleanInput('annotations'),
      eslintArgs: getInput('eslint-args').split(' '),
      binPath: getInput('bin-path'),
      extensions: getInput('extensions').split(',').map((ext) => ext.trim()),
    };

    await runEslint(inputs);
    process.exit(0);
  } catch (err) {
    setFailed(err.message);
  }
}