How to use @octokit/action - 3 common examples

To help you get started, we’ve selected a few @octokit/action 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 octokit / graphql-action / index.js View on Github external
async function main() {
  try {
    ``;
    const octokit = new Octokit();
    const { query, ...variables } = getAllInputs();

    core.info(query);
    for (const [name, value] of Object.entries(variables)) {
      core.info(`> ${name}: ${value}`);
    }

    const time = Date.now();
    const data = await octokit.graphql(query, variables);

    core.info(`< 200 ${Date.now() - time}ms`);

    core.setOutput("data", JSON.stringify(data, null, 2));
  } catch (error) {
    core.debug(inspect(error));
    core.setFailed(error.message);
github octokit / request-action / index.js View on Github external
async function main() {
  try {
    const octokit = new Octokit();
    const { route, ...parameters } = getAllInputs();

    core.info(route);
    for (const [name, value] of Object.entries(parameters)) {
      core.info(`> ${name}: ${value}`);
    }

    core.debug(`route: ${inspect(route)}`);
    core.debug(`parameters: ${inspect(parameters)}`);
    core.debug(
      `parsed request options: ${inspect(
        octokit.request.endpoint(route, parameters)
      )}`
    );

    const time = Date.now();
github gr2m / twitter-together / lib / index.js View on Github external
async function main() {
  const octokit = new Octokit();

  const payload = JSON.parse(
    readFileSync(process.env.GITHUB_EVENT_PATH, "utf8")
  );
  const ref = process.env.GITHUB_REF;
  const sha = process.env.GITHUB_SHA;

  const state = {
    toolkit,
    octokit,
    payload,
    ref,
    sha,
    startedAt: new Date().toISOString(),
    twitterCredentials: {
      consumer_key: process.env.TWITTER_API_KEY,

@octokit/action

GitHub API client for GitHub Actions

MIT
Latest version published 8 months ago

Package Health Score

80 / 100
Full package analysis

Popular @octokit/action functions