File tree 4 files changed +129
-211
lines changed
.github/actions/assign-dependabot-reviewer 4 files changed +129
-211
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import axios from 'axios' ;
2
2
import { setFailed } from '@actions/core' ;
3
3
import { reviewersMap } from "./config/reviewers.mjs" ;
4
+ import { Octokit } from '@octokit/action'
4
5
5
6
const GITHUB_TOKEN = process . env . GITHUB_TOKEN ;
6
7
const REPO = process . env . GITHUB_REPOSITORY ;
7
8
const PR_NUMBER = process . env . PR_NUMBER ;
9
+ const octokit = new Octokit ( ) ;
8
10
9
11
const headers = {
10
12
'Authorization' : `token ${ GITHUB_TOKEN } ` ,
11
13
'Accept' : 'application/vnd.github.v3+json' ,
12
14
} ;
13
15
16
+ /**
17
+ * Pull the PR details from the
18
+ * @returns {Promise<any> }
19
+ */
14
20
async function getPRDetails ( ) {
15
- const url = `https://github.com/api/repos/${ REPO } /pulls/${ PR_NUMBER } ` ;
16
- const response = await axios . get ( url , { headers} ) ;
17
- return response . data ;
21
+ return await octokit . rest . pulls . get ( {
22
+ repo : REPO ,
23
+ pull_number : PR_NUMBER
24
+ } )
18
25
}
19
26
20
27
async function assignReviewers ( team_reviewers ) {
Original file line number Diff line number Diff line change 9
9
},
10
10
"dependencies" : {
11
11
"@actions/core" : " ^1.10.0" ,
12
- "axios" : " ^1.3.0"
12
+ "@octokit/action" : " ^7.0.0" ,
13
+ "axios" : " ^1.7.7"
13
14
},
14
15
"devDependencies" : {
15
16
"@eslint/js" : " ^9.9.1" ,
You can’t perform that action at this time.
0 commit comments