You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-20Lines changed: 25 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,13 @@ defined, so you don't have to (see examples below).
32
32
See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client
33
33
documentation.
34
34
35
-
**Note** This action is still a bit of an experiment—the API may change in
36
-
future versions. 🙂
35
+
## Breaking changes in V5
36
+
37
+
Version 5 of this action includes the version 5 of `@actions/github` and `@octokit/plugin-rest-endpoint-methods`. As part of this update, the Octokit context available via `github` no longer has REST methods directly. These methods are available via `github.rest.*` - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0
38
+
39
+
For example, `github.issues.createComment` in V4 becomes `github.rest.issues.createComment` in V5
40
+
41
+
`github.request`, `github.paginate`, and `github.graphql` are unchanged.
37
42
38
43
## Development
39
44
@@ -45,7 +50,7 @@ The return value of the script will be in the step's outputs under the
45
50
"result" key.
46
51
47
52
```yaml
48
-
- uses: actions/github-script@v4
53
+
- uses: actions/github-script@v5
49
54
id: set-result
50
55
with:
51
56
script: return "Hello!"
@@ -64,7 +69,7 @@ output of a github-script step. For some workflows, string encoding is preferred
64
69
`result-encoding` input:
65
70
66
71
```yaml
67
-
- uses: actions/github-script@v4
72
+
- uses: actions/github-script@v5
68
73
id: my-script
69
74
with:
70
75
result-encoding: string
@@ -82,7 +87,7 @@ By default, github-script will use the token provided to your workflow.
82
87
83
88
```yaml
84
89
- name: View context attributes
85
-
uses: actions/github-script@v4
90
+
uses: actions/github-script@v5
86
91
with:
87
92
script: console.log(context)
88
93
```
@@ -98,10 +103,10 @@ jobs:
98
103
comment:
99
104
runs-on: ubuntu-latest
100
105
steps:
101
-
- uses: actions/github-script@v4
106
+
- uses: actions/github-script@v5
102
107
with:
103
108
script: |
104
-
github.issues.createComment({
109
+
github.rest.issues.createComment({
105
110
issue_number: context.issue.number,
106
111
owner: context.repo.owner,
107
112
repo: context.repo.repo,
@@ -120,10 +125,10 @@ jobs:
120
125
apply-label:
121
126
runs-on: ubuntu-latest
122
127
steps:
123
-
- uses: actions/github-script@v4
128
+
- uses: actions/github-script@v5
124
129
with:
125
130
script: |
126
-
github.issues.addLabels({
131
+
github.rest.issues.addLabels({
127
132
issue_number: context.issue.number,
128
133
owner: context.repo.owner,
129
134
repo: context.repo.repo,
@@ -140,13 +145,13 @@ jobs:
140
145
welcome:
141
146
runs-on: ubuntu-latest
142
147
steps:
143
-
- uses: actions/github-script@v4
148
+
- uses: actions/github-script@v5
144
149
with:
145
150
script: |
146
151
// Get a list of all issues created by the PR opener
0 commit comments