Skip to content

Commit

Permalink
Merge pull request #103 from martincostello/Fix-octokit-Usage
Browse files Browse the repository at this point in the history
Fix octokit usage
  • Loading branch information
martincostello authored Dec 14, 2021
2 parents 664dfe0 + 568bb34 commit 9bbebe4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class DotNetSdkUpdater {
url: ""
};
}
const response = await octokit.pulls.create(request);
const response = await octokit.rest.pulls.create(request);
core.debug(JSON.stringify(response, null, 2));
core.info(`Created pull request #${response.data.number}: ${response.data.title}`);
core.info(`View the pull request at ${response.data.html_url}`);
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@actions/io": "^1.1.1"
},
"devDependencies": {
"@octokit/types": "^6.34.0",
"@types/jest": "^27.0.3",
"jest": "^26.4.2",
"jest-circus": "^27.4.5",
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetSdkUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class DotNetSdkUpdater {
};
}

const response = await octokit.pulls.create(request);
const response = await octokit.rest.pulls.create(request);

core.debug(JSON.stringify(response, null, 2));

Expand Down
16 changes: 9 additions & 7 deletions tests/update-dotnet-sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ describe("update-dotnet-sdk tests", () => {
issues: {
addLabels: () => Promise.resolve({})
},
pulls: {
create: () => Promise.resolve({
data: {
number: "42",
html_url: "https://github.com/martincostello/update-dotnet-sdk/pull/42"
}
})
rest: {
pulls: {
create: () => Promise.resolve({
data: {
number: "42",
html_url: "https://github.com/martincostello/update-dotnet-sdk/pull/42"
}
})
}
}
});

Expand Down

0 comments on commit 9bbebe4

Please sign in to comment.