File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 41
41
- name : Format Check
42
42
run : node ./tools/index.js
43
43
44
- - name : Push changes # push the output folder to your repo
45
- uses : ad-m/github-push-action@master
44
+ - name : Try commit
45
+ uses : EndBug/add-and-commit@v9
46
46
with :
47
- github_token : ${{ secrets.GH_PAT }}
48
- force : true
49
- force_with_lease : true
47
+ add : ' scripts'
Original file line number Diff line number Diff line change @@ -5,22 +5,19 @@ import { parseHeader } from "./header-parser";
5
5
import { readmeFilenames , scripts , scriptsPath } from "./utils" ;
6
6
7
7
function pushCommitGit ( packages : string [ ] ) {
8
- // add auth token
9
- writeFileSync ( './github-token' , process . env . PR_TOKEN ?? '' ) ;
10
-
11
- // github commit push
12
8
const title = `Add README to ${ packages . length } packages` ;
13
9
const description = [
14
10
`Add README file to the following packages:` ,
15
11
packages . join ( ', ' )
16
12
] ;
17
13
const commands = [
18
14
"git --version" ,
19
- 'git config --global user.email "[email protected] "' ,
20
- 'git config --global user.name "github-actions"' ,
21
- "git add ./scripts" ,
15
+ 'git config user.email "41898282+github-actions[bot]@users.noreply.github.com"' ,
16
+ 'git config user.name "github-actions[bot]"' ,
22
17
"git status" ,
18
+ "git add scripts" ,
23
19
`git commit -m ${ JSON . stringify ( title ) } -m ${ JSON . stringify ( description . join ( '\n' ) ) } ` ,
20
+ "git push origin HEAD:" + process . env . REF ,
24
21
] ;
25
22
26
23
for ( const cmd of commands ) {
@@ -98,7 +95,7 @@ export function execute (): 0 | 1 {
98
95
}
99
96
100
97
// attempt to commit
101
- if ( scriptsChanged . length > 0 ) pushCommitGit ( scriptsChanged ) ;
98
+ if ( scriptsChanged . length > 0 ) console . warn ( `Add README to ${ scriptsChanged . length } packages` ) ;
102
99
else console . log ( "All script packages have a README file." ) ;
103
100
104
101
return 0 ;
You can’t perform that action at this time.
0 commit comments