Skip to content

Commit ab38af0

Browse files
committed
only git commit/push if there is a diff
1 parent 7bf9854 commit ab38af0

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,19 @@ jobs:
4646
mv -v output/RomanWAS_new/images/truth/Roman_WAS_truth_J129_12909_4.fits.gz reference/RomanWAS_new/images/truth/Roman_WAS_truth_J129_12909_4.fits.gz
4747
fi
4848
49-
if diff output/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt reference/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt); then
49+
if diff output/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt reference/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt; then
5050
echo "reference table is unchanged"
5151
else
5252
echo "reference table is changed"
5353
mv -v output/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt reference/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt
5454
fi
5555
56-
git add reference
57-
git commit -m "Update reference"
58-
git push
56+
if git diff --exit-code; then
57+
echo "reference/ is unchanged; no action needed"
58+
else
59+
echo "reference/ is changed; pushing updates"
60+
git add reference
61+
git commit -m "Update reference"
62+
git push
63+
fi
64+

0 commit comments

Comments
 (0)