Skip to content

Commit

Permalink
update token
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jul 27, 2024
1 parent 25be5d7 commit a8aee13
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions test/test-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ const getPullRequestChanges = async () => {
// myToken: ${{ secrets.GITHUB_TOKEN }}
// https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret
const myToken = core.getInput('myToken');
console.log('myToken', `${myToken}`.length);
console.log('myToken', myToken);

// const octokit = github.getOctokit(myToken);
console.log('github.token', github.token);

const octokit = github.getOctokit(myToken || github.token);

// // You can also pass in additional options as a second parameter to getOctokit
// // const octokit = github.getOctokit(myToken, {userAgent: "MyActionVersion1"});

// const { data } = await octokit.rest.pulls.get({
// owner: 'octokit',
// repo: 'rest.js',
// pull_number: 123,
// mediaType: {
// format: 'diff'
// }
// });
const { data } = await octokit.rest.pulls.get({
owner: 'octokit',
repo: 'rest.js',
pull_number: 123,
mediaType: {
format: 'diff'
}
});

// return data;
return data;
};


Expand Down

0 comments on commit a8aee13

Please sign in to comment.