mirror of
https://github.com/actions/github-script.git
synced 2026-04-07 14:49:25 +00:00
Merge branch 'main' into joshmgross/node-20
This commit is contained in:
commit
5349cf9965
7 changed files with 52 additions and 4 deletions
18
README.md
18
README.md
|
|
@ -424,6 +424,24 @@ jobs:
|
|||
await printStuff()
|
||||
```
|
||||
|
||||
### Use scripts with jsDoc support
|
||||
|
||||
If you want type support for your scripts, you could use the command below to install the
|
||||
`github-script` type declaration.
|
||||
```sh
|
||||
$ npm i -D @types/github-script@github:actions/github-script
|
||||
```
|
||||
|
||||
And then add the `jsDoc` declaration to your script like this:
|
||||
```js
|
||||
// @ts-check
|
||||
/** @param {import('@types/github-script').AsyncFunctionArguments} AsyncFunctionArguments */
|
||||
export default async ({ core, context }) => {
|
||||
core.debug("Running something at the moment");
|
||||
return context.actor;
|
||||
};
|
||||
```
|
||||
|
||||
### Use env as input
|
||||
|
||||
You can set env vars to use them in your script:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue