@@ -15,12 +15,12 @@ async function run () {
15
15
16
16
// If this is not a PR, use the current branch.
17
17
if ( ! branch ) branch = process . env . GITHUB_REF
18
-
18
+
19
19
// Output the branch that will be used.
20
20
logger . info ( 'Using branch:' , branch )
21
21
22
22
// TODO: check if branch exists and create it if necessary.
23
-
23
+
24
24
// Check if there are local changes.
25
25
const { stdout : hasChanges } = await execa ( 'git' , [ 'status' , '--porcelain' ] )
26
26
if ( hasChanges ) {
@@ -29,7 +29,7 @@ async function run () {
29
29
? process . env . INPUT_FILES . split ( '\n' )
30
30
: '.'
31
31
await execa ( 'git' , [ 'add' , files ] )
32
-
32
+
33
33
// Check if there are staged changes.
34
34
const args = [ 'diff' , '--staged' , '--name-only' ]
35
35
const { stdout : hasStaged } = await execa ( 'git' , args )
@@ -39,7 +39,7 @@ async function run () {
39
39
await execa ( 'git' , [ 'config' , '--global' , 'user.name' , author ] )
40
40
const email = 'github-actions[bot]@users.noreply.github.com'
41
41
await execa ( 'git' , [ 'config' , '--global' , 'user.email' , email ] )
42
-
42
+
43
43
// Commit the changes.
44
44
const message = process . env . INPUT_MESSAGE || 'Automated commit'
45
45
await execa ( 'git' , [ 'commit' , '-m' , message ] )
@@ -51,12 +51,12 @@ async function run () {
51
51
const origin = token
52
52
? `https://${ actor } :${ token } @github.com/${ repo } .git`
53
53
: 'origin'
54
- await execa ( 'git' , [ 'push' , origin , `HEAD:${ branch } ` ] )
54
+ await execa ( 'git' , [ 'push' , origin , `HEAD:${ branch } ` ] )
55
55
} else {
56
56
logger . info ( 'No staged files' , { hasStaged } )
57
57
}
58
58
} else {
59
- logger . info ( 'No local changes' , { hasChanges } )
59
+ logger . info ( 'No local changes' , { hasChanges } )
60
60
}
61
61
}
62
62
0 commit comments