Skip to content

Commit

Permalink
use @actions/github@5 and remove GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed May 5, 2023
1 parent e2565ae commit 1ffe3bd
Show file tree
Hide file tree
Showing 5 changed files with 12,492 additions and 33,312 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ Learn more: [CommentAuthorAssociation | GitHub Developer Guide](https://develope

Here are available variables and functions in the ```` ```js ```` code block.

| variable | examples | type or reference |
|----------------|----------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| `context` | `context.repo.owner`, `context.payload.comment` | [toolkit/context.ts at @actions/github@1.1.0 · actions/toolkit] |
| `githubToken` | `new GitHub(githubToken)` | |
| `githubClient` | `await githubClient.pulls.create(...)`, `await githubClient.graphql(...)` | [toolkit/packages/github at master · actions/toolkit] |
| `execSync` | `execSync("ls -l")` | [child_process.execSync()] |
| `postComment` | `await postComment("**hey!**")` | `(markdown: string) => Promise<void>`, post GitHub issue/pull request comment |
| `GitHub` | `new GitHub(githubToken)` | [toolkit/packages/github at master · actions/toolkit] |
| `fetch` | `await fetch("https://example.com")` | [node-fetch/node-fetch: A light-weight module that brings window.fetch to Node.js] |
| `core` | `core.debug('my message')` | [toolkit/packages/core at master · actions/toolkit] |
| `exec` | `await exec.exec("git status")` | [toolkit/packages/exec at master · actions/toolkit] |
| variable | examples | type or reference |
|-----------------------------|----------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| `context` | `context.repo.owner`, `context.payload.comment` | [toolkit/context.ts at @actions/github@1.1.0 · actions/toolkit] |
| `githubToken` | `require('@actions/github').getOctokit(githubToken)` | |
| `octokit` | `await octokit.rest.pulls.create(...)`, `await octokit.graphql(...)` | [toolkit/packages/github at master · actions/toolkit] |
| `execSync` | `execSync("ls -l")` | [child_process.execSync()] |
| `postComment` | `await postComment("**hey!**")` | `(markdown: string) => Promise<void>`, post GitHub issue/pull request comment |
| `fetch` | `await fetch("https://example.com")` | [node-fetch/node-fetch: A light-weight module that brings window.fetch to Node.js] |
| `core` | `core.debug('my message')` | [toolkit/packages/core at master · actions/toolkit] |
| `exec` | `await exec.exec("git status")` | [toolkit/packages/exec at master · actions/toolkit] |
| (deprecated) `githubClient` | `await githubClient.pulls.create(...)`, `await githubClient.graphql(...)` | [toolkit/packages/github at master · actions/toolkit] |

Other built-in variables and functions in Node.js such as `process` and `require(...)` are also available. This means you can use `process.env` for environment variables and `require('fs')` for file access.

Expand Down
Loading

0 comments on commit 1ffe3bd

Please sign in to comment.