Merge branch 'main' into joshmgross/node-20

This commit is contained in:
Josh Gross
2023-11-08 09:45:02 -05:00
7 changed files with 52 additions and 4 deletions

View File

@@ -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: