File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 run : composer update
2323
2424 - name : Generate Documentation
25- run : php ./makeDocs.php
25+ run : php ./makeDocs.php --push
2626
2727 - name : Commit & Push to Wiki
2828 run : |
Original file line number Diff line number Diff line change 3030include "vendor/skayo/phpdoc-md/bin/phpdocmd " ;
3131echo " Complete. \n" ;
3232
33- //
34- //echo "Committing and pushing to Repository...";
35- //echo exec("cd " . __DIR__ . "/docs && git add *.md && git commit -m \"Auto-Updated Documentation\" && git push");
36- //echo " Complete.\n";
33+ // if git diff has no results, exit.
34+ $ diff = trim (exec ("cd " . __DIR__ . "/docs && git diff --stat " ));
35+ if ($ diff === "" ) {
36+ echo "No changes detected in documentation. Exiting. \n" ;
37+ exit (0 );
38+ }
39+
40+
41+ echo "Committing and pushing to Repository... " ;
42+ echo exec ("cd " . __DIR__ . "/docs && git add *.md && git commit -m \"Auto-Updated Documentation \"" );
43+ echo " Complete. \n" ;
44+
45+ // if --push is set, push the changes.
46+ if (in_array ("--push " , $ argv )) {
47+ echo "Pushing to remote repository... " ;
48+ echo exec ("cd " . __DIR__ . "/docs && git push " );
49+ echo " Complete. \n" ;
50+ }
You can’t perform that action at this time.
0 commit comments