build(deps): bump @actions/github from 4.0.0 to 5.0.0 (#305)

* build(deps): bump @actions/github from 4.0.0 to 5.0.0

Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

Signed-off-by: dependabot[bot] <support@github.com>

* fix: Update @action/github 5

* build: new deps & rest fix

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: marocchino <marocchino@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2021-05-30 10:50:41 +09:00 committed by GitHub
parent 21998583f4
commit 7874cc39cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 336 additions and 167 deletions

View file

@ -49,6 +49,7 @@ it('findPreviousComment', async () => {
} }
] ]
const octokit: any = { const octokit: any = {
rest: {
issues: { issues: {
listComments: jest.fn(() => listComments: jest.fn(() =>
Promise.resolve({ Promise.resolve({
@ -62,6 +63,7 @@ it('findPreviousComment', async () => {
) )
} }
} }
}
expect(await findPreviousComment(octokit, repo, 123, '')).toBe(comment) expect(await findPreviousComment(octokit, repo, 123, '')).toBe(comment)
expect(await findPreviousComment(octokit, repo, 123, 'TypeA')).toBe( expect(await findPreviousComment(octokit, repo, 123, 'TypeA')).toBe(
@ -70,7 +72,7 @@ it('findPreviousComment', async () => {
expect(await findPreviousComment(octokit, repo, 123, 'LegacyComment')).toBe( expect(await findPreviousComment(octokit, repo, 123, 'LegacyComment')).toBe(
headerFirstComment headerFirstComment
) )
expect(octokit.issues.listComments).toBeCalledWith({ expect(octokit.rest.issues.listComments).toBeCalledWith({
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment', repo: 'sticky-pull-request-comment',
issue_number: 123 issue_number: 123
@ -82,17 +84,19 @@ describe('updateComment', () => {
beforeEach(() => { beforeEach(() => {
octokit = { octokit = {
rest: {
issues: { issues: {
updateComment: jest.fn(() => Promise.resolve()) updateComment: jest.fn(() => Promise.resolve())
} }
} }
}
}) })
it('with comment body', async () => { it('with comment body', async () => {
expect( expect(
await updateComment(octokit, repo, 456, 'hello there', '') await updateComment(octokit, repo, 456, 'hello there', '')
).toBeUndefined() ).toBeUndefined()
expect(octokit.issues.updateComment).toBeCalledWith({ expect(octokit.rest.issues.updateComment).toBeCalledWith({
comment_id: 456, comment_id: 456,
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment', repo: 'sticky-pull-request-comment',
@ -101,7 +105,7 @@ describe('updateComment', () => {
expect( expect(
await updateComment(octokit, repo, 456, 'hello there', 'TypeA') await updateComment(octokit, repo, 456, 'hello there', 'TypeA')
).toBeUndefined() ).toBeUndefined()
expect(octokit.issues.updateComment).toBeCalledWith({ expect(octokit.rest.issues.updateComment).toBeCalledWith({
comment_id: 456, comment_id: 456,
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment', repo: 'sticky-pull-request-comment',
@ -117,7 +121,7 @@ describe('updateComment', () => {
'hello there\n<!-- Sticky Pull Request CommentTypeA -->' 'hello there\n<!-- Sticky Pull Request CommentTypeA -->'
) )
).toBeUndefined() ).toBeUndefined()
expect(octokit.issues.updateComment).toBeCalledWith({ expect(octokit.rest.issues.updateComment).toBeCalledWith({
comment_id: 456, comment_id: 456,
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment', repo: 'sticky-pull-request-comment',
@ -125,9 +129,9 @@ describe('updateComment', () => {
}) })
}) })
it('without comment body and previousbody', async () => { it('without comment body and previous body', async () => {
expect(await updateComment(octokit, repo, 456, '', '')).toBeUndefined() expect(await updateComment(octokit, repo, 456, '', '')).toBeUndefined()
expect(octokit.issues.updateComment).not.toBeCalled() expect(octokit.rest.issues.updateComment).not.toBeCalled()
expect(core.warning).toBeCalledWith('Comment body cannot be blank') expect(core.warning).toBeCalledWith('Comment body cannot be blank')
}) })
}) })
@ -137,17 +141,19 @@ describe('createComment', () => {
beforeEach(() => { beforeEach(() => {
octokit = { octokit = {
rest: {
issues: { issues: {
createComment: jest.fn(() => Promise.resolve()) createComment: jest.fn(() => Promise.resolve())
} }
} }
}
}) })
it('with comment body or previousBody', async () => { it('with comment body or previousBody', async () => {
expect( expect(
await createComment(octokit, repo, 456, 'hello there', '') await createComment(octokit, repo, 456, 'hello there', '')
).toBeUndefined() ).toBeUndefined()
expect(octokit.issues.createComment).toBeCalledWith({ expect(octokit.rest.issues.createComment).toBeCalledWith({
issue_number: 456, issue_number: 456,
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment', repo: 'sticky-pull-request-comment',
@ -156,7 +162,7 @@ describe('createComment', () => {
expect( expect(
await createComment(octokit, repo, 456, 'hello there', 'TypeA') await createComment(octokit, repo, 456, 'hello there', 'TypeA')
).toBeUndefined() ).toBeUndefined()
expect(octokit.issues.createComment).toBeCalledWith({ expect(octokit.rest.issues.createComment).toBeCalledWith({
issue_number: 456, issue_number: 456,
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment', repo: 'sticky-pull-request-comment',
@ -165,19 +171,21 @@ describe('createComment', () => {
}) })
it('without comment body and previousBody', async () => { it('without comment body and previousBody', async () => {
expect(await createComment(octokit, repo, 456, '', '')).toBeUndefined() expect(await createComment(octokit, repo, 456, '', '')).toBeUndefined()
expect(octokit.issues.createComment).not.toBeCalled() expect(octokit.rest.issues.createComment).not.toBeCalled()
expect(core.warning).toBeCalledWith('Comment body cannot be blank') expect(core.warning).toBeCalledWith('Comment body cannot be blank')
}) })
}) })
it('deleteComment', async () => { it('deleteComment', async () => {
const octokit: any = { const octokit: any = {
rest: {
issues: { issues: {
deleteComment: jest.fn(() => Promise.resolve()) deleteComment: jest.fn(() => Promise.resolve())
} }
} }
}
expect(await deleteComment(octokit, repo, 456)).toBeUndefined() expect(await deleteComment(octokit, repo, 456)).toBeUndefined()
expect(octokit.issues.deleteComment).toBeCalledWith({ expect(octokit.rest.issues.deleteComment).toBeCalledWith({
comment_id: 456, comment_id: 456,
owner: 'marocchino', owner: 'marocchino',
repo: 'sticky-pull-request-comment' repo: 'sticky-pull-request-comment'

299
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

9
dist/licenses.txt generated vendored
View file

@ -12,6 +12,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@actions/github @actions/github
MIT MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client @actions/http-client
MIT MIT

8
lib/comment.js generated
View file

@ -35,7 +35,7 @@ function headerComment(header) {
} }
function findPreviousComment(octokit, repo, issue_number, header) { function findPreviousComment(octokit, repo, issue_number, header) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const { data: comments } = yield octokit.issues.listComments(Object.assign(Object.assign({}, repo), { issue_number })); const { data: comments } = yield octokit.rest.issues.listComments(Object.assign(Object.assign({}, repo), { issue_number }));
const h = headerComment(header); const h = headerComment(header);
return comments.find(comment => { var _a; return (_a = comment.body) === null || _a === void 0 ? void 0 : _a.includes(h); }); return comments.find(comment => { var _a; return (_a = comment.body) === null || _a === void 0 ? void 0 : _a.includes(h); });
}); });
@ -45,7 +45,7 @@ function updateComment(octokit, repo, comment_id, body, header, previousBody) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (!body && !previousBody) if (!body && !previousBody)
return core.warning('Comment body cannot be blank'); return core.warning('Comment body cannot be blank');
yield octokit.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody yield octokit.rest.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody
? `${previousBody}\n${body}` ? `${previousBody}\n${body}`
: `${body}\n${headerComment(header)}` })); : `${body}\n${headerComment(header)}` }));
}); });
@ -55,7 +55,7 @@ function createComment(octokit, repo, issue_number, body, header, previousBody)
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (!body && !previousBody) if (!body && !previousBody)
return core.warning('Comment body cannot be blank'); return core.warning('Comment body cannot be blank');
yield octokit.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody
? `${previousBody}\n${body}` ? `${previousBody}\n${body}`
: `${body}\n${headerComment(header)}` })); : `${body}\n${headerComment(header)}` }));
}); });
@ -63,7 +63,7 @@ function createComment(octokit, repo, issue_number, body, header, previousBody)
exports.createComment = createComment; exports.createComment = createComment;
function deleteComment(octokit, repo, comment_id) { function deleteComment(octokit, repo, comment_id) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
yield octokit.issues.deleteComment(Object.assign(Object.assign({}, repo), { comment_id })); yield octokit.rest.issues.deleteComment(Object.assign(Object.assign({}, repo), { comment_id }));
}); });
} }
exports.deleteComment = deleteComment; exports.deleteComment = deleteComment;

107
package-lock.json generated
View file

@ -10,20 +10,20 @@
"integrity": "sha512-xxtX0Cwdhb8LcgatfJkokqT8KzPvcIbwL9xpLU09nOwBzaStbfm0dNncsP0M4us+EpoPdWy7vbzU5vSOH7K6pg==" "integrity": "sha512-xxtX0Cwdhb8LcgatfJkokqT8KzPvcIbwL9xpLU09nOwBzaStbfm0dNncsP0M4us+EpoPdWy7vbzU5vSOH7K6pg=="
}, },
"@actions/github": { "@actions/github": {
"version": "4.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-4.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
"integrity": "sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==", "integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
"requires": { "requires": {
"@actions/http-client": "^1.0.8", "@actions/http-client": "^1.0.11",
"@octokit/core": "^3.0.0", "@octokit/core": "^3.4.0",
"@octokit/plugin-paginate-rest": "^2.2.3", "@octokit/plugin-paginate-rest": "^2.13.3",
"@octokit/plugin-rest-endpoint-methods": "^4.0.0" "@octokit/plugin-rest-endpoint-methods": "^5.1.1"
} }
}, },
"@actions/http-client": { "@actions/http-client": {
"version": "1.0.9", "version": "1.0.11",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.9.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
"integrity": "sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==", "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
"requires": { "requires": {
"tunnel": "0.0.6" "tunnel": "0.0.6"
} }
@ -1035,99 +1035,98 @@
} }
}, },
"@octokit/auth-token": { "@octokit/auth-token": {
"version": "2.4.4", "version": "2.4.5",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.4.tgz", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz",
"integrity": "sha512-LNfGu3Ro9uFAYh10MUZVaT7X2CnNm2C8IDQmabx+3DygYIQjs9FwzFAHN/0t6mu5HEPhxcb1XOuxdpY82vCg2Q==", "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==",
"requires": { "requires": {
"@octokit/types": "^6.0.0" "@octokit/types": "^6.0.3"
} }
}, },
"@octokit/core": { "@octokit/core": {
"version": "3.2.4", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.2.4.tgz", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.4.0.tgz",
"integrity": "sha512-d9dTsqdePBqOn7aGkyRFe7pQpCXdibSJ5SFnrTr0axevObZrpz3qkWm7t/NjYv5a66z6vhfteriaq4FRz3e0Qg==", "integrity": "sha512-6/vlKPP8NF17cgYXqucdshWqmMZGXkuvtcrWCgU5NOI0Pl2GjlmZyWgBMrU8zJ3v2MJlM6++CiB45VKYmhiWWg==",
"requires": { "requires": {
"@octokit/auth-token": "^2.4.4", "@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8", "@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.4.12", "@octokit/request": "^5.4.12",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3", "@octokit/types": "^6.0.3",
"before-after-hook": "^2.1.0", "before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
} }
}, },
"@octokit/endpoint": { "@octokit/endpoint": {
"version": "6.0.10", "version": "6.0.11",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.10.tgz", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.11.tgz",
"integrity": "sha512-9+Xef8nT7OKZglfkOMm7IL6VwxXUQyR7DUSU0LH/F7VNqs8vyd7es5pTfz9E7DwUIx7R3pGscxu1EBhYljyu7Q==", "integrity": "sha512-fUIPpx+pZyoLW4GCs3yMnlj2LfoXTWDUVPTC4V3MUEKZm48W+XYpeWSZCv+vYF1ZABUm2CqnDVf1sFtIYrj7KQ==",
"requires": { "requires": {
"@octokit/types": "^6.0.0", "@octokit/types": "^6.0.3",
"is-plain-object": "^5.0.0", "is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
} }
}, },
"@octokit/graphql": { "@octokit/graphql": {
"version": "4.5.8", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.8.tgz", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.6.2.tgz",
"integrity": "sha512-WnCtNXWOrupfPJgXe+vSmprZJUr0VIu14G58PMlkWGj3cH+KLZEfKMmbUQ6C3Wwx6fdhzVW1CD5RTnBdUHxhhA==", "integrity": "sha512-WmsIR1OzOr/3IqfG9JIczI8gMJUMzzyx5j0XXQ4YihHtKlQc+u35VpVoOXhlKAlaBntvry1WpAzPl/a+s3n89Q==",
"requires": { "requires": {
"@octokit/request": "^5.3.0", "@octokit/request": "^5.3.0",
"@octokit/types": "^6.0.0", "@octokit/types": "^6.0.3",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
} }
}, },
"@octokit/openapi-types": { "@octokit/openapi-types": {
"version": "5.1.1", "version": "7.2.1",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-5.1.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-7.2.1.tgz",
"integrity": "sha512-yMyaX9EDWCiyv7m85/K8L7bLFj1wrLdfDkKcZEZ6gNmepSW5mfSMFJnYwRINN7lF58wvevKPWvw0MYy6sxcFlQ==" "integrity": "sha512-IHQJpLciwzwDvciLxiFj3IEV5VYn7lSVcj5cu0jbTwMfK4IG6/g8SPrVp3Le1VRzIiYSRcBzm1dA7vgWelYP3Q=="
}, },
"@octokit/plugin-paginate-rest": { "@octokit/plugin-paginate-rest": {
"version": "2.7.1", "version": "2.13.3",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.7.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.3.tgz",
"integrity": "sha512-dUsxsEIrBqhlQNfXRhMhXOTQi0SSG38+QWcPGO226HFPFJk44vWukegHfMG3496vLv9T2oT7IuAGssGpcUg5bQ==", "integrity": "sha512-46lptzM9lTeSmIBt/sVP/FLSTPGx6DCzAdSX3PfeJ3mTf4h9sGC26WpaQzMEq/Z44cOcmx8VsOhO+uEgE3cjYg==",
"requires": { "requires": {
"@octokit/types": "^6.3.1" "@octokit/types": "^6.11.0"
} }
}, },
"@octokit/plugin-rest-endpoint-methods": { "@octokit/plugin-rest-endpoint-methods": {
"version": "4.5.2", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.5.2.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.0.tgz",
"integrity": "sha512-JXoDIh+QnzFb6C5ZqIcUzDkn1fLrxawi98ZbvYb9s7Z2CJLITUWpbTAxSgseczEho18pYhamEBRR/h3o3HIXJQ==", "integrity": "sha512-+4NAJ9WzPN5gW6W1H1tblw/DesTD6PaWuU5+/x3Pa7nyK6qjR6cn4jwkJtzxVPTgtzryOFLX+5vs7MROFswp5Q==",
"requires": { "requires": {
"@octokit/types": "^6.3.2", "@octokit/types": "^6.16.0",
"deprecation": "^2.3.1" "deprecation": "^2.3.1"
} }
}, },
"@octokit/request": { "@octokit/request": {
"version": "5.4.12", "version": "5.4.15",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.12.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.15.tgz",
"integrity": "sha512-MvWYdxengUWTGFpfpefBBpVmmEYfkwMoxonIB3sUGp5rhdgwjXL1ejo6JbgzG/QD9B/NYt/9cJX1pxXeSIUCkg==", "integrity": "sha512-6UnZfZzLwNhdLRreOtTkT9n57ZwulCve8q3IT/Z477vThu6snfdkBuhxnChpOKNGxcQ71ow561Qoa6uqLdPtag==",
"requires": { "requires": {
"@octokit/endpoint": "^6.0.1", "@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.0.0", "@octokit/request-error": "^2.0.0",
"@octokit/types": "^6.0.3", "@octokit/types": "^6.7.1",
"deprecation": "^2.0.0",
"is-plain-object": "^5.0.0", "is-plain-object": "^5.0.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"once": "^1.4.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
} }
}, },
"@octokit/request-error": { "@octokit/request-error": {
"version": "2.0.4", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.4.tgz", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.5.tgz",
"integrity": "sha512-LjkSiTbsxIErBiRh5wSZvpZqT4t0/c9+4dOe0PII+6jXR+oj/h66s7E4a/MghV7iT8W9ffoQ5Skoxzs96+gBPA==", "integrity": "sha512-T/2wcCFyM7SkXzNoyVNWjyVlUwBvW3igM3Btr/eKYiPmucXTtkxt2RBsf6gn3LTzaLSLTQtNmvg+dGsOxQrjZg==",
"requires": { "requires": {
"@octokit/types": "^6.0.0", "@octokit/types": "^6.0.3",
"deprecation": "^2.0.0", "deprecation": "^2.0.0",
"once": "^1.4.0" "once": "^1.4.0"
} }
}, },
"@octokit/types": { "@octokit/types": {
"version": "6.10.1", "version": "6.16.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.10.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.0.tgz",
"integrity": "sha512-hgNC5jxKG8/RlqxU/6GThkGrvFpz25+cPzjQjyiXTNBvhyltn2Z4GhFY25+kbtXwZ4Co4zM0goW5jak1KLp1ug==", "integrity": "sha512-EktqSNq8EKXE82a7Vw33ozOEhFXIRik+rZHJTHAgVZRm/p2K5r5ecn5fVpRkLCm3CAVFwchRvt3yvtmfbt2LCQ==",
"requires": { "requires": {
"@octokit/openapi-types": "^5.1.0" "@octokit/openapi-types": "^7.2.0"
} }
}, },
"@sinonjs/commons": { "@sinonjs/commons": {
@ -1766,9 +1765,9 @@
"dev": true "dev": true
}, },
"before-after-hook": { "before-after-hook": {
"version": "2.1.0", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.1.tgz",
"integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" "integrity": "sha512-/6FKxSTWoJdbsLDF8tdIjaRiFXiE6UHsEHE3OPI/cwPURCVi1ukP0gmLn7XWEiFk5TcwQjjY5PWsU+j+tgXgmw=="
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",

View file

@ -27,7 +27,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.3.0", "@actions/core": "^1.3.0",
"@actions/github": "^4.0.0" "@actions/github": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.23", "@types/jest": "^26.0.23",

View file

@ -14,7 +14,7 @@ export async function findPreviousComment(
issue_number: number, issue_number: number,
header: string header: string
): Promise<{body?: string; id: number} | undefined> { ): Promise<{body?: string; id: number} | undefined> {
const {data: comments} = await octokit.issues.listComments({ const {data: comments} = await octokit.rest.issues.listComments({
...repo, ...repo,
issue_number issue_number
}) })
@ -35,7 +35,7 @@ export async function updateComment(
if (!body && !previousBody) if (!body && !previousBody)
return core.warning('Comment body cannot be blank') return core.warning('Comment body cannot be blank')
await octokit.issues.updateComment({ await octokit.rest.issues.updateComment({
...repo, ...repo,
comment_id, comment_id,
body: previousBody body: previousBody
@ -57,7 +57,7 @@ export async function createComment(
if (!body && !previousBody) if (!body && !previousBody)
return core.warning('Comment body cannot be blank') return core.warning('Comment body cannot be blank')
await octokit.issues.createComment({ await octokit.rest.issues.createComment({
...repo, ...repo,
issue_number, issue_number,
body: previousBody body: previousBody
@ -73,7 +73,7 @@ export async function deleteComment(
}, },
comment_id: number comment_id: number
): Promise<void> { ): Promise<void> {
await octokit.issues.deleteComment({ await octokit.rest.issues.deleteComment({
...repo, ...repo,
comment_id comment_id
}) })