Skip to content

Commit cd12edf

Browse files
authored
Migrate to github.getOctokit() (kt3k#6)
1 parent 7830c23 commit cd12edf

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ async function run() {
1212
const base = inputs.destinationBranch;
1313
const source = github.context.ref.replace(/^refs\/heads\//, "");
1414

15-
const octokit = new github.GitHub(inputs.githubToken);
16-
15+
const octokit = github.getOctokit(inputs.githubToken);
1716
core.info(`Look up a pull request with source=${source} base=${base}`);
18-
const { data: pulls } = await octokit.pulls.list({
17+
const { data: pulls } = await octokit.rest.pulls.list({
1918
owner: github.context.repo.owner,
2019
repo: github.context.repo.repo,
2120
base,
@@ -44,7 +43,7 @@ async function run() {
4443
core.info(`Updating with title=#${inputs.prTitle}`);
4544
params.title = inputs.prTitle;
4645
}
47-
await octokit.pulls.update(params);
46+
await octokit.rest.pulls.update(params);
4847
}
4948

5049
run()

node_modules/.package-lock.json

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

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "update-pull-request-description-on-push",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Update pull request description on push",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)