File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -151,15 +151,17 @@ update_doc() {
151
151
exit $success
152
152
fi
153
153
154
- if [ " ${INPUT_OUTPUT_METHOD} " == " inject" ] || [ " ${INPUT_OUTPUT_METHOD} " == " replace" ]; then
154
+ if { [ " ${INPUT_OUTPUT_METHOD} " = " inject" ] || [ " ${INPUT_OUTPUT_METHOD} " = " replace" ] ; } && [ " ${INPUT_GIT_PUSH} " = " true " ]; then
155
155
git_add " ${working_dir} /${OUTPUT_FILE} "
156
156
fi
157
157
}
158
158
159
159
# go to github repo
160
160
cd " ${GITHUB_WORKSPACE} "
161
161
162
- git_setup
162
+ if [ " ${INPUT_GIT_PUSH} " = " true" ] || [ " ${INPUT_FAIL_ON_DIFF} " = " true" ]; then
163
+ git_setup
164
+ fi
163
165
164
166
if [ -f " ${GITHUB_WORKSPACE} /${INPUT_ATLANTIS_FILE} " ]; then
165
167
# Parse an atlantis yaml file
@@ -178,11 +180,13 @@ else
178
180
done
179
181
fi
180
182
181
- # always set num_changed output
182
- set +e
183
- num_changed=$( git_status)
184
- set -e
185
- echo " num_changed=${num_changed} " >> " $GITHUB_OUTPUT "
183
+ if [ " ${INPUT_GIT_PUSH} " = " true" ] || [ " ${INPUT_FAIL_ON_DIFF} " = " true" ]; then
184
+ # set num_changed output only if git is enabled
185
+ set +e
186
+ num_changed=$( git_status)
187
+ set -e
188
+ echo " num_changed=${num_changed} " >> " $GITHUB_OUTPUT "
189
+ fi
186
190
187
191
if [ " ${INPUT_GIT_PUSH} " = " true" ]; then
188
192
git_commit
You can’t perform that action at this time.
0 commit comments