Skip to content

Commit 657c576

Browse files
author
Benjamin Muskalla
committed
Skip diffs if same branch
1 parent 38debc0 commit 657c576

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/java-model-diff.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,30 @@ jobs:
6767
ls -1 "$d"
6868
6969
analyzeDatabaseWithCheckout "baseline" $d
70-
analyzeDatabaseWithCheckout "head" $d
70+
if [[ "$s1" != "$s2" ]]
71+
then
72+
analyzeDatabaseWithCheckout "head" $d
73+
fi
7174
done
7275
- name: Install diff2html
7376
run: |
7477
npm install -g diff2html-cli
7578
- name: Generate Model Diff
7679
run: |
7780
set -x
78-
MODELS=`pwd`/tmp-models
79-
ls -1 tmp-models/
80-
for m in $MODELS/*_baseline.qll ; do
81-
t="${m/baseline/"head"}"
82-
basename=`basename $m`
83-
name="diff_${basename/_baseline.qll/""}"
84-
(diff -w -u $m $t | diff2html -i stdin -F $MODELS/$name.html) || true
85-
done
81+
if [[ "$s1" == "$s2" ]]
82+
then
83+
echo "Skipping diff generation as github.base_ref and github.ref are the same"
84+
else
85+
MODELS=`pwd`/tmp-models
86+
ls -1 tmp-models/
87+
for m in $MODELS/*_baseline.qll ; do
88+
t="${m/baseline/"head"}"
89+
basename=`basename $m`
90+
name="diff_${basename/_baseline.qll/""}"
91+
(diff -w -u $m $t | diff2html -i stdin -F $MODELS/$name.html) || true
92+
done
93+
fi
8694
- uses: actions/upload-artifact@v2
8795
with:
8896
name: models

0 commit comments

Comments
 (0)