Skip to content

Commit

Permalink
CI: skip doc commit job
Browse files Browse the repository at this point in the history
TODO:
$CI_COMMIT_BEFORE_SHA is 00 for first commits; so need to handle better the
before sha to be origin/master or pr base branch
doc-skip: use gitlab specific git refs to understand changesets

Also never skip schedules

Signed-off-by: Abhishek Lekshmanan <[email protected]>
  • Loading branch information
theanalyst committed Jan 29, 2025
1 parent 39bf590 commit 55f51ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ workflow:
#-------------------------------------------------------------------------------
# Prebuild
#-------------------------------------------------------------------------------
doc-skip:
.doc-skip:
stage: .pre
script:
- |
if git diff --name-only HEAD..FETCH_HEAD | grep -qv '^docs/'; then
if git diff --name-only $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA | grep -qv '^docs/'; then
echo "Non doc changes detected, running full pipeline"
exit 0
fi
Expand All @@ -68,6 +68,8 @@ doc-skip:
exit 1
allow_failure: true
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- changes:
- docs/**/*
when: always
Expand Down

0 comments on commit 55f51ff

Please sign in to comment.