Skip to content

Commit 3039d46

Browse files
committed
fix: new syntax for @actions/github package code
1 parent e80b383 commit 3039d46

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

3-
const core = require('@actions/core')
4-
const { getOctokit, context } = require('@actions/github')
3+
const core = require('@actions/core');
4+
const github = require('@actions/github');
55

66
const main = async () => {
77
const token = core.getInput('github-token', {
@@ -26,7 +26,8 @@ const main = async () => {
2626
required: false
2727
});// merge|squash|rebase|fast-forward
2828

29-
const octokit = getOctokit(token);
29+
const octokit = github.getOctokit(token);
30+
const context = github.context;
3031

3132
if (!context.actor.match(allowed_usernames)) {
3233
core.warning('Ignored, the username does not match.');
@@ -35,7 +36,7 @@ const main = async () => {
3536
core.info('Username matched.');
3637
}
3738

38-
const pullRequest = await octokit.pulls.get({
39+
const pullRequest = await octokit.rest.pulls.get({
3940
...context.repo,
4041
...context.owner,
4142
pull_number: number

0 commit comments

Comments
 (0)