@@ -14,6 +14,8 @@ setup() {
1414 export INPUT_COMMIT_MESSAGE=" Commit Message"
1515 export INPUT_BRANCH=" master"
1616 export INPUT_COMMIT_OPTIONS=" "
17+ export INPUT_ADD_OPTIONS=" "
18+ export INPUT_STATUS_OPTIONS=" "
1719 export INPUT_FILE_PATTERN=" ."
1820 export INPUT_COMMIT_USER_NAME=" Test Suite"
1921 export INPUT_COMMIT_USER_EMAIL=" test@github.com"
@@ -115,6 +117,20 @@ git_auto_commit() {
115117 assert_line " ::debug::Push commit to remote branch master"
116118}
117119
120+ @test " It applies INPUT_STATUS_OPTIONS when running dirty check" {
121+ INPUT_STATUS_OPTIONS=" --untracked-files=no"
122+
123+ touch " ${FAKE_LOCAL_REPOSITORY} " /new-file-{1,2}.php
124+
125+ run git_auto_commit
126+
127+ assert_success
128+
129+ assert_line " INPUT_REPOSITORY value: ${INPUT_REPOSITORY} "
130+ assert_line " ::set-output name=changes_detected::false"
131+ assert_line " Working tree clean. Nothing to commit."
132+ }
133+
118134@test " It prints a 'Nothing to commit' message in a clean repository" {
119135 run git_auto_commit
120136
@@ -142,6 +158,28 @@ git_auto_commit() {
142158 assert_line " ::debug::Apply commit options "
143159}
144160
161+ @test " It applies INPUT_ADD_OPTIONS when adding files" {
162+ INPUT_FILE_PATTERN=" "
163+ INPUT_STATUS_OPTIONS=" --untracked-files=no"
164+ INPUT_ADD_OPTIONS=" -u"
165+
166+ date > " ${FAKE_LOCAL_REPOSITORY} " /remote-files1.txt
167+ touch " ${FAKE_LOCAL_REPOSITORY} " /new-file-{1,2}.php
168+
169+ run git_auto_commit
170+
171+ assert_success
172+
173+ assert_line " INPUT_STATUS_OPTIONS: --untracked-files=no"
174+ assert_line " INPUT_ADD_OPTIONS: -u"
175+ assert_line " INPUT_FILE_PATTERN: "
176+ assert_line " ::debug::Push commit to remote branch master"
177+
178+ # Assert that PHP files have not been added.
179+ run git status
180+ assert_output --partial ' new-file-1.php'
181+ }
182+
145183@test " It applies INPUT_FILE_PATTERN when creating commit" {
146184 INPUT_FILE_PATTERN=" *.txt *.html"
147185
0 commit comments