|
1 |
| -# script |
| 1 | +# github-script |
2 | 2 |
|
3 |
| -This action makes it easy to quickly write a script in your workflow that uses the GitHub API and the workflow run context. |
| 3 | +This action makes it easy to quickly write a script in your workflow that |
| 4 | +uses the GitHub API and the workflow run context. |
4 | 5 |
|
5 |
| -In order to use this action, a `script` input is provided. The value of that input should be the body of an asynchronous function call. Two arguments will be provided: |
| 6 | +In order to use this action, a `script` input is provided. The value of that |
| 7 | +input should be the body of an asynchronous function call. Two arguments will |
| 8 | +be provided: |
6 | 9 |
|
7 |
| -- `github` A pre-authenticated [octokit/rest.js](https://github.com/octokit/rest.js) client |
8 |
| -- `context` An object containing the [context of the workflow run](https://github.com/actions/toolkit/tree/master/packages/github) |
| 10 | +- `github` A pre-authenticated |
| 11 | + [octokit/rest.js](https://github.com/octokit/rest.js) client |
| 12 | +- `context` An object containing the [context of the workflow |
| 13 | + run](https://github.com/actions/toolkit/tree/master/packages/github) |
9 | 14 |
|
10 |
| -Since the `script` is just a function body, these values will already be defined, so you don't have to (see examples below). |
| 15 | +Since the `script` is just a function body, these values will already be |
| 16 | +defined, so you don't have to (see examples below). |
11 | 17 |
|
12 |
| -See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client documentation. |
| 18 | +See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client |
| 19 | +documentation. |
| 20 | + |
| 21 | +**Note** This action is still a bit of an experiment—the API may change in |
| 22 | +*future versions. 🙂 |
13 | 23 |
|
14 | 24 | ## Examples
|
15 | 25 |
|
|
23 | 33 | comment:
|
24 | 34 | runs-on: ubuntu-latest
|
25 | 35 | steps:
|
26 |
| - - uses: actions/script@1.0.0 |
| 36 | + - uses: actions/github-script@0.1.0 |
27 | 37 | with:
|
28 | 38 | github-token: ${{github.token}}
|
29 | 39 | script: |
|
|
40 | 50 | apply-label:
|
41 | 51 | runs-on: ubuntu-latest
|
42 | 52 | steps:
|
43 |
| - - uses: actions/script@1.0.0 |
| 53 | + - uses: actions/github-script@0.1.0 |
44 | 54 | with:
|
45 | 55 | github-token: ${{github.token}}
|
46 | 56 | script: |
|
|
56 | 66 | welcome:
|
57 | 67 | runs-on: ubuntu-latest
|
58 | 68 | steps:
|
59 |
| - - uses: actions/script@1.0.0 |
| 69 | + - uses: actions/github-script@0.1.0 |
60 | 70 | with:
|
61 | 71 | github-token: ${{github.token}}
|
62 | 72 | script: |
|
|
0 commit comments