|
64 | 64 | fi |
65 | 65 |
|
66 | 66 | git add --all |
67 | | - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 67 | + |
| 68 | + if ! git diff-index --quiet --cached HEAD; then |
| 69 | + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 70 | + else |
| 71 | + echo "No staged changes to commit." |
| 72 | + exit 0 |
| 73 | + fi |
68 | 74 |
|
69 | 75 | if [ $? -eq 0 ]; then |
70 | 76 | git push --set-upstream origin ${GITHUB_SHA::8} |
@@ -119,7 +125,13 @@ jobs: |
119 | 125 | fi |
120 | 126 |
|
121 | 127 | git add --all |
122 | | - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 128 | + |
| 129 | + if ! git diff-index --quiet --cached HEAD; then |
| 130 | + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 131 | + else |
| 132 | + echo "No staged changes to commit." |
| 133 | + exit 0 |
| 134 | + fi |
123 | 135 |
|
124 | 136 | if [ $? -eq 0 ]; then |
125 | 137 | git push --set-upstream origin ${GITHUB_SHA::8} |
@@ -167,7 +179,13 @@ jobs: |
167 | 179 | fi |
168 | 180 |
|
169 | 181 | git add --all |
170 | | - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 182 | + |
| 183 | + if ! git diff-index --quiet --cached HEAD; then |
| 184 | + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 185 | + else |
| 186 | + echo "No staged changes to commit." |
| 187 | + exit 0 |
| 188 | + fi |
171 | 189 |
|
172 | 190 | if [ $? -eq 0 ]; then |
173 | 191 | git push --set-upstream origin ${GITHUB_SHA::8} |
@@ -215,7 +233,13 @@ jobs: |
215 | 233 | fi |
216 | 234 |
|
217 | 235 | git add --all |
218 | | - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 236 | + |
| 237 | + if ! git diff-index --quiet --cached HEAD; then |
| 238 | + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a |
| 239 | + else |
| 240 | + echo "No staged changes to commit." |
| 241 | + exit 0 |
| 242 | + fi |
219 | 243 |
|
220 | 244 | if [ $? -eq 0 ]; then |
221 | 245 | git push --set-upstream origin ${GITHUB_SHA::8} |
|
0 commit comments