How to use the actions-toolkit/lib/graphql.withDefaults function in actions-toolkit

To help you get started, weā€™ve selected a few actions-toolkit 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 atom / github / actions / auto-sprint / index.js View on Github external
Toolkit.run(async tools => {
  // Re-authenticate with the correct secret.
  tools.github.graphql = withDefaults(process.env.GRAPHQL_TOKEN);

  // Ensure that the actor of the triggering action belongs to the core team
  const actorLogin = tools.context.actor;
  const teamResponse = await tools.github.graphql(`
    query {
      organization(login: "atom") {
        team(slug: "github-package") {
          members(first: 100) {
            nodes {
              login
            }
          }
        }
      }
    }
  `);

actions-toolkit

A toolkit for building GitHub Actions in Node.js

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis