Skip to content

Commit 026d823

Browse files
fix: broken @actions/github
1 parent 07c49b2 commit 026d823

7 files changed

+47
-97
lines changed

dist/index.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18024,7 +18024,7 @@ var __webpack_exports__ = {}
1802418024
const excludes = core.getInput('excludes')
1802518025

1802618026
const octokit = github.getOctokit(process.env.GITHUB_TOKEN)
18027-
const { data: list } = await octokit.pulls.listFiles({
18027+
const { data: list } = await octokit.rest.pulls.listFiles({
1802818028
...context.repo,
1802918029
pull_number: pullNumber
1803018030
})
@@ -18072,7 +18072,7 @@ var __webpack_exports__ = {}
1807218072
hasErrors = results.filter((r) => r.errors && r.errors.length > 0)
1807318073
const message = comment(results)
1807418074
if (message && message.length > 0) {
18075-
await octokit.issues.createComment({
18075+
await octokit.rest.issues.createComment({
1807618076
...context.repo,
1807718077
issue_number: context.payload.number,
1807818078
body: `SEO Check: \n\n${message}`

dist/index.mjs.map

+1-1
Large diffs are not rendered by default.

package-lock.json

+16-68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
],
2424
"main": "dist/index.js",
2525
"scripts": {
26+
"start": "node -r dotenv/config src/index.mjs",
2627
"build": "npm run lint && npm run test && npm run prepare",
2728
"postinstall": "husky install",
2829
"lint": "eslint .",
@@ -47,7 +48,6 @@
4748
"dependencies": {
4849
"@actions/core": "^1.4.0",
4950
"@actions/github": "^5.0.0",
50-
"@octokit/action": "^3.12.0",
5151
"glob-to-regexp": "^0.4.1",
5252
"gray-matter": "^4.0.3",
5353
"node-fetch": "^2.6.1",

src/index.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function run() {
1919
hasErrors = results.filter((r) => r.errors && r.errors.length > 0)
2020
const message = comment(results)
2121
if (message && message.length > 0) {
22-
await octokit.issues.createComment({
22+
await octokit.rest.issues.createComment({
2323
...context.repo,
2424
issue_number: context.payload.number,
2525
body: `SEO Check: \n\n${message}`

src/listFiles.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async function files() {
1010
const excludes = core.getInput('excludes')
1111

1212
const octokit = github.getOctokit(process.env.GITHUB_TOKEN)
13-
const { data: list } = await octokit.pulls.listFiles({
13+
const { data: list } = await octokit.rest.pulls.listFiles({
1414
...context.repo,
1515
pull_number: pullNumber
1616
})

test/listFiles.test.js

+25-23
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,31 @@ jest.mock('@actions/github', () => {
2727
},
2828
getOctokit: jest.fn().mockImplementation(() => {
2929
return {
30-
pulls: {
31-
listFiles: jest.fn().mockImplementation(() => {
32-
return {
33-
data: [
34-
{
35-
filename: '/exclude/index.md',
36-
raw_url: 'https://github.com/test/test/raw/123/exclude.md'
37-
},
38-
{
39-
filename: 'test.md',
40-
raw_url: 'https://github.com/test/test/raw/123/test.md'
41-
},
42-
{
43-
filename: '/include/index.mdx',
44-
raw_url: 'https://github.com/test/test/raw/123/index.mdx'
45-
},
46-
{
47-
filename: '/include/blog.md',
48-
raw_url: 'https://github.com/test/test/raw/123/blog.md'
49-
}
50-
]
51-
}
52-
})
30+
rest: {
31+
pulls: {
32+
listFiles: jest.fn().mockImplementation(() => {
33+
return {
34+
data: [
35+
{
36+
filename: '/exclude/index.md',
37+
raw_url: 'https://github.com/test/test/raw/123/exclude.md'
38+
},
39+
{
40+
filename: 'test.md',
41+
raw_url: 'https://github.com/test/test/raw/123/test.md'
42+
},
43+
{
44+
filename: '/include/index.mdx',
45+
raw_url: 'https://github.com/test/test/raw/123/index.mdx'
46+
},
47+
{
48+
filename: '/include/blog.md',
49+
raw_url: 'https://github.com/test/test/raw/123/blog.md'
50+
}
51+
]
52+
}
53+
})
54+
}
5355
}
5456
}
5557
})

0 commit comments

Comments
 (0)