@@ -36,7 +36,7 @@ function normalizeName(problemName) {
3636 return problemName . toLowerCase ( ) . replace ( / \s / g, '_' ) ;
3737}
3838
39- async function commit ( octokit , destinationFolder , owner , repo , defaultBranch , commitInfo , treeSHA , latestCommitSHA , submission ) {
39+ async function commit ( octokit , owner , repo , defaultBranch , commitInfo , treeSHA , latestCommitSHA , submission , destinationFolder ) {
4040 const name = normalizeName ( submission . title ) ;
4141 log ( `Committing solution for ${ name } ...` ) ;
4242
@@ -115,7 +115,7 @@ function addToSubmissions(response, lastTimestamp, filterDuplicateSecs, submissi
115115 return true ;
116116}
117117
118- async function sync ( destinationFolder , githubToken , owner , repo , filterDuplicateSecs , leetcodeCSRFToken , leetcodeSession ) {
118+ async function sync ( githubToken , owner , repo , filterDuplicateSecs , leetcodeCSRFToken , leetcodeSession , destinationFolder ) {
119119 const octokit = new Octokit ( {
120120 auth : githubToken ,
121121 userAgent : 'LeetCode sync to GitHub - GitHub Action' ,
@@ -205,7 +205,7 @@ async function sync(destinationFolder, githubToken, owner, repo, filterDuplicate
205205 let treeSHA = commits . data [ 0 ] . commit . tree . sha ;
206206 for ( i = submissions . length - 1 ; i >= 0 ; i -- ) {
207207 submission = submissions [ i ] ;
208- [ treeSHA , latestCommitSHA ] = await commit ( octokit , destinationFolder , owner , repo , defaultBranch , commitInfo , treeSHA , latestCommitSHA , submission ) ;
208+ [ treeSHA , latestCommitSHA ] = await commit ( octokit , owner , repo , defaultBranch , commitInfo , treeSHA , latestCommitSHA , submission , destinationFolder ) ;
209209 }
210210 log ( 'Done syncing all submissions.' ) ;
211211}
@@ -219,7 +219,7 @@ async function main() {
219219 const leetcodeSession = core . getInput ( 'leetcode-session' ) ;
220220 const filterDuplicateSecs = core . getInput ( 'filter-duplicate-secs' ) ;
221221
222- await sync ( destinationFolder , githubToken , owner , repo , filterDuplicateSecs , leetcodeCSRFToken , leetcodeSession ) ;
222+ await sync ( githubToken , owner , repo , filterDuplicateSecs , leetcodeCSRFToken , leetcodeSession , destinationFolder ) ;
223223}
224224
225225main ( ) . catch ( ( error ) => {
0 commit comments