File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,17 +2,16 @@ require('dotenv').config()
22const { Octokit } = require ( "@octokit/core" )
33
44module . exports = async function ( filepath ) {
5- // Translate Windows-style paths to Unix-style paths.
6- filepath = filepath . replace ( / \\ / g, "/" )
5+ const unixStyleFilepath = filepath . replace ( / \\ / g, "/" )
76 const octokit = new Octokit ( {
87 auth : process . env . TOKEN
98 } )
109 const { repository : { object : { history } } } = await octokit . graphql (
11- `{
10+ `query ($filepath: String!) {
1211 repository(owner: "InnerSourceCommons", name: "InnerSourceLearningPath") {
1312 object(expression: "main") {
1413 ... on Commit {
15- history(first: 100, path: " ${ filepath } " ) {
14+ history(first: 100, path: $ filepath) {
1615 totalCount
1716 nodes {
1817 authors(first: 100) {
@@ -44,7 +43,9 @@ module.exports = async function (filepath) {
4443 }
4544 }
4645 }
47- }`
46+ }` , {
47+ filepath : unixStyleFilepath
48+ }
4849 )
4950
5051 if ( history . totalCount > 100 ) {
You can’t perform that action at this time.
0 commit comments