Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05e1495

Browse files
authored
Merge 4e1175c into deb7ae9
2 parents deb7ae9 + 4e1175c commit 05e1495

13 files changed

+510
-441
lines changed

.github/workflows/pull-request-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
script: |
1616
// Get the existing comments.
17-
const {data: comments} = await github.issues.listComments({
17+
const {data: comments} = await github.rest.issues.listComments({
1818
owner: context.repo.owner,
1919
repo: context.repo.repo,
2020
issue_number: context.payload.number,
@@ -28,14 +28,14 @@ jobs:
2828
console.log('Not attempting to write comment on PR from fork');
2929
} else {
3030
if (botComment) {
31-
await github.issues.updateComment({
31+
await github.rest.issues.updateComment({
3232
owner: context.repo.owner,
3333
repo: context.repo.repo,
3434
comment_id: botComment.id,
3535
body: commentBody
3636
})
3737
} else {
38-
await github.issues.createComment({
38+
await github.rest.issues.createComment({
3939
owner: context.repo.owner,
4040
repo: context.repo.repo,
4141
issue_number: context.payload.number,

.licenses/npm/@actions/github.dep.yml

Lines changed: 10 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/glob.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/http-client.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/openapi-types.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/types-5.5.0.dep.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.licenses/npm/@octokit/types-6.30.0.dep.yml renamed to .licenses/npm/@octokit/types.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@types/node.dep.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ defined, so you don't have to (see examples below).
3232
See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client
3333
documentation.
3434

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.
3742

3843
## Development
3944

@@ -45,7 +50,7 @@ The return value of the script will be in the step's outputs under the
4550
"result" key.
4651

4752
```yaml
48-
- uses: actions/github-script@v4
53+
- uses: actions/github-script@v5
4954
id: set-result
5055
with:
5156
script: return "Hello!"
@@ -64,7 +69,7 @@ output of a github-script step. For some workflows, string encoding is preferred
6469
`result-encoding` input:
6570

6671
```yaml
67-
- uses: actions/github-script@v4
72+
- uses: actions/github-script@v5
6873
id: my-script
6974
with:
7075
result-encoding: string
@@ -82,7 +87,7 @@ By default, github-script will use the token provided to your workflow.
8287

8388
```yaml
8489
- name: View context attributes
85-
uses: actions/github-script@v4
90+
uses: actions/github-script@v5
8691
with:
8792
script: console.log(context)
8893
```
@@ -98,10 +103,10 @@ jobs:
98103
comment:
99104
runs-on: ubuntu-latest
100105
steps:
101-
- uses: actions/github-script@v4
106+
- uses: actions/github-script@v5
102107
with:
103108
script: |
104-
github.issues.createComment({
109+
github.rest.issues.createComment({
105110
issue_number: context.issue.number,
106111
owner: context.repo.owner,
107112
repo: context.repo.repo,
@@ -120,10 +125,10 @@ jobs:
120125
apply-label:
121126
runs-on: ubuntu-latest
122127
steps:
123-
- uses: actions/github-script@v4
128+
- uses: actions/github-script@v5
124129
with:
125130
script: |
126-
github.issues.addLabels({
131+
github.rest.issues.addLabels({
127132
issue_number: context.issue.number,
128133
owner: context.repo.owner,
129134
repo: context.repo.repo,
@@ -140,13 +145,13 @@ jobs:
140145
welcome:
141146
runs-on: ubuntu-latest
142147
steps:
143-
- uses: actions/github-script@v4
148+
- uses: actions/github-script@v5
144149
with:
145150
script: |
146151
// Get a list of all issues created by the PR opener
147152
// See: https://octokit.github.io/rest.js/#pagination
148153
const creator = context.payload.sender.login
149-
const opts = github.issues.listForRepo.endpoint.merge({
154+
const opts = github.rest.issues.listForRepo.endpoint.merge({
150155
...context.issue,
151156
creator,
152157
state: 'all'
@@ -163,7 +168,7 @@ jobs:
163168
}
164169
}
165170
166-
await github.issues.createComment({
171+
await github.rest.issues.createComment({
167172
issue_number: context.issue.number,
168173
owner: context.repo.owner,
169174
repo: context.repo.repo,
@@ -183,7 +188,7 @@ jobs:
183188
diff:
184189
runs-on: ubuntu-latest
185190
steps:
186-
- uses: actions/github-script@v4
191+
- uses: actions/github-script@v5
187192
with:
188193
script: |
189194
const diff_url = context.payload.pull_request.diff_url
@@ -207,7 +212,7 @@ jobs:
207212
list-issues:
208213
runs-on: ubuntu-latest
209214
steps:
210-
- uses: actions/github-script@v4
215+
- uses: actions/github-script@v5
211216
with:
212217
script: |
213218
const query = `query($owner:String!, $name:String!, $label:String!) {
@@ -241,7 +246,7 @@ jobs:
241246
runs-on: ubuntu-latest
242247
steps:
243248
- uses: actions/checkout@v2
244-
- uses: actions/github-script@v4
249+
- uses: actions/github-script@v5
245250
with:
246251
script: |
247252
const script = require('./path/to/script.js')
@@ -279,7 +284,7 @@ jobs:
279284
runs-on: ubuntu-latest
280285
steps:
281286
- uses: actions/checkout@v2
282-
- uses: actions/github-script@v4
287+
- uses: actions/github-script@v5
283288
env:
284289
SHA: '${{env.parentSHA}}'
285290
with:
@@ -323,7 +328,7 @@ jobs:
323328
- run: npm ci
324329
# or one-off:
325330
- run: npm install execa
326-
- uses: actions/github-script@v4
331+
- uses: actions/github-script@v5
327332
with:
328333
script: |
329334
const execa = require('execa')
@@ -344,7 +349,7 @@ jobs:
344349
echo-input:
345350
runs-on: ubuntu-latest
346351
steps:
347-
- uses: actions/github-script@v4
352+
- uses: actions/github-script@v5
348353
env:
349354
FIRST_NAME: Mona
350355
LAST_NAME: Octocat
@@ -372,11 +377,11 @@ jobs:
372377
apply-label:
373378
runs-on: ubuntu-latest
374379
steps:
375-
- uses: actions/github-script@v4
380+
- uses: actions/github-script@v5
376381
with:
377382
github-token: ${{ secrets.MY_PAT }}
378383
script: |
379-
github.issues.addLabels({
384+
github.rest.issues.addLabels({
380385
issue_number: context.issue.number,
381386
owner: context.repo.owner,
382387
repo: context.repo.repo,

0 commit comments

Comments
 (0)