Skip to content

Commit 094726f

Browse files
Merge pull request #255 from regulaforensics/update-actions
Update "update-clients" action
2 parents e682ecc + c766f35 commit 094726f

File tree

1 file changed

+52
-9
lines changed

1 file changed

+52
-9
lines changed

.github/workflows/update-clients.yml

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,21 @@ jobs:
5757
git checkout -b ${GITHUB_SHA::8}
5858
git config --local user.email "action@github.com"
5959
git config --local user.name "GitHub Action"
60+
61+
if git diff-index --quiet HEAD --; then
62+
echo "No changes to commit."
63+
exit 0
64+
fi
65+
6066
git add --all
6167
git commit -m "Commit: ${{ needs.title.outputs.title }}" -a
62-
git push --set-upstream origin ${GITHUB_SHA::8}
63-
gh pr create --fill --base develop
68+
69+
if [ $? -eq 0 ]; then
70+
git push --set-upstream origin ${GITHUB_SHA::8}
71+
gh pr create --fill --base develop
72+
else
73+
echo "Nothing to commit."
74+
fi
6475
env:
6576
GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }}
6677

@@ -100,10 +111,21 @@ jobs:
100111
git checkout -b ${GITHUB_SHA::8}
101112
git config --local user.email "action@github.com"
102113
git config --local user.name "GitHub Action"
114+
115+
if git diff-index --quiet HEAD --; then
116+
echo "No changes to commit."
117+
exit 0
118+
fi
119+
103120
git add --all
104121
git commit -m "Commit: ${{ needs.title.outputs.title }}" -a
105-
git push --set-upstream origin ${GITHUB_SHA::8}
106-
gh pr create --fill --base develop
122+
123+
if [ $? -eq 0 ]; then
124+
git push --set-upstream origin ${GITHUB_SHA::8}
125+
gh pr create --fill --base develop
126+
else
127+
echo "Nothing to commit."
128+
fi
107129
env:
108130
GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }}
109131

@@ -136,10 +158,21 @@ jobs:
136158
git checkout -b ${GITHUB_SHA::8}
137159
git config --local user.email "action@github.com"
138160
git config --local user.name "GitHub Action"
161+
162+
if git diff-index --quiet HEAD --; then
163+
echo "No changes to commit."
164+
exit 0
165+
fi
166+
139167
git add --all
140168
git commit -m "Commit: ${{ needs.title.outputs.title }}" -a
141-
git push --set-upstream origin ${GITHUB_SHA::8}
142-
gh pr create --fill --base develop
169+
170+
if [ $? -eq 0 ]; then
171+
git push --set-upstream origin ${GITHUB_SHA::8}
172+
gh pr create --fill --base develop
173+
else
174+
echo "Nothing to commit."
175+
fi
143176
env:
144177
GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }}
145178

@@ -172,10 +205,20 @@ jobs:
172205
git checkout -b ${GITHUB_SHA::8}
173206
git config --local user.email "action@github.com"
174207
git config --local user.name "GitHub Action"
175-
git checkout src/Regula.DocumentReader.WebClient/Api/DefaultApi.cs src/Regula.DocumentReader.WebClient/Api/ProcessApi.cs
208+
209+
if git diff-index --quiet HEAD --; then
210+
echo "No changes to commit."
211+
exit 0
212+
fi
213+
176214
git add --all
177215
git commit -m "Commit: ${{ needs.title.outputs.title }}" -a
178-
git push --set-upstream origin ${GITHUB_SHA::8}
179-
gh pr create --fill --base develop
216+
217+
if [ $? -eq 0 ]; then
218+
git push --set-upstream origin ${GITHUB_SHA::8}
219+
gh pr create --fill --base develop
220+
else
221+
echo "Nothing to commit."
222+
fi
180223
env:
181224
GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }}

0 commit comments

Comments
 (0)