mirror of
https://github.com/actions/github-script.git
synced 2025-12-25 23:23:07 +00:00
Merge branch 'main' into joshmgross/node-20
This commit is contained in:
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:
|
||||
|
||||
Reference in New Issue
Block a user