File tree Expand file tree Collapse file tree 5 files changed +302
-5
lines changed
Expand file tree Collapse file tree 5 files changed +302
-5
lines changed Original file line number Diff line number Diff line change 1212 env :
1313 issueToken : ${{secrets.issueToken}}
1414 run : npm run daily-schedule
15+ - name : Commit static
16+ run : |
17+ git config --global user.name 'robot'
18+ git commit -am "feat: from daily schedule"
19+ git push
Original file line number Diff line number Diff line change 11const { Octokit } = require ( "@octokit/rest" ) ;
22const fs = require ( "fs" ) ;
3+ const path = require ( "path" ) ;
34const { getDay } = require ( "../utils/day" ) ;
45const { owner, repo } = require ( "../config/index" ) ;
6+
57const solutions = require ( "../static/solution/solutions.json" ) ;
68const mySolutions = require ( "../static/my/solutions.json" ) ;
79
@@ -29,7 +31,7 @@ if (problem && problem.issue_number) {
2931 } ) ;
3032
3133 fs . writeFileSync (
32- "../static/my/solutions.json" ,
34+ path . resolve ( __dirname , "../static/my/solutions.json" ) ,
3335 JSON . stringify ( mySolutions )
3436 ) ;
3537 } ) ;
Original file line number Diff line number Diff line change 11const { Octokit } = require ( "@octokit/rest" ) ;
22const fs = require ( "fs" ) ;
3+ const path = require ( "path" ) ;
34const { getDay } = require ( "../utils/day" ) ;
45const { owner, repo } = require ( "../config/index" ) ;
6+
57const solutions = require ( "../static/solution/solutions.json" ) ;
8+
69const octokit = new Octokit ( { auth : process . env . issueToken } ) ;
710
811const solution = solutions [ getDay ( ) ] ;
@@ -48,7 +51,7 @@ async function run() {
4851 solution . issue_number = data . number ;
4952
5053 fs . writeFileSync (
51- "../static/solution/solutions.json" ,
54+ path . resolve ( __dirname , "../static/solution/solutions.json" ) ,
5255 JSON . stringify ( solutions )
5356 ) ;
5457}
Original file line number Diff line number Diff line change 77 {
88 "title" : " 232. 用栈实现队列" ,
99 "url" : " https://github.com/leetcode-pp/91alg-4/issues/1#issuecomment-833191484" ,
10- "body" : " 2121 "
10+ "body" : " "
1111 },
1212 null ,
1313 {
1414 "title" : " 768. 最多能完成排序的块 II" ,
1515 "url" : " https://github.com/leetcode-pp/91alg-4/issues/1#issuecomment-833191484" ,
16- "body" : " 2121 "
16+ "body" : " "
1717 },
1818 null ,
1919 null ,
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments