Skip to content

Commit bf12e15

Browse files
author
Derek Barbosa
committed
Prevent deploy job from failing when there is nothing to commit
Fixes: !635 JIRA: INTERNAL Introduce a quick change to the git commit step of the job to prevent the runner from failing when there is nothing to commit Signed-off-by: Derek Barbosa <debarbos@redhat.com>
1 parent 1955c09 commit bf12e15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ deploy:
142142
- git config user.name "Gitlab Runner"
143143
- git config user.email ""
144144
- git add info/owners.yaml info/RHMAINTAINERS info/CODEOWNERS
145-
- git commit -m "[Gitlab CI/CD] Automated rebuild of info/*"
145+
# make it so that job will not fail if there is nothing to commit
146+
- git diff-index --quiet HEAD || git commit -m "[Gitlab CI/CD] Automated rebuild of info/*"
146147
- git push https://gitlab-ci-token:$MAKE_MAINT@gitlab.com/redhat/centos-stream/src/kernel/documentation.git '$CI_DEFAULT_BRANCH'
147148

148149
rules:

0 commit comments

Comments
 (0)