Skip to content

Commit fd57110

Browse files
authored
[CI] Fix crash when grep finds no matches (#18457)
## Why - The original implementation would crash when grep returned a non-zero exit code (pattern not found) ## How - Add `|| true` to prevent early return - Minor update: remove redundant stage definiation since we got default stage config ## Result if I don't have ci docker images installed **before** <img width="686" height="65" alt="image" src="https://github.com/user-attachments/assets/b6ec2fdb-2bcc-4441-9e8f-fa391d54e17f" /> **after** <img width="1207" height="304" alt="image" src="https://github.com/user-attachments/assets/877321a2-88ca-4ac3-946c-2285b668323e" />
1 parent 0225d67 commit fd57110

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ repos:
4343
- id: check-merge-conflict
4444
- id: check-yaml
4545
- id: end-of-file-fixer
46-
stages: [pre-push]
4746
- id: trailing-whitespace
48-
stages: [pre-push]
47+
4948
- repo: local
5049
hooks:
5150
- id: run-black

docker/dev_common.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ INVOCATION_PWD="$(pwd)"
2727

2828
GIT_TOPLEVEL=$(cd $(dirname ${BASH_SOURCE[0]}) && git rev-parse --show-toplevel)
2929

30-
DOCKER_IS_ROOTLESS=$(docker info 2> /dev/null | grep 'Context: \+rootless')
31-
30+
DOCKER_IS_ROOTLESS=$(docker info 2> /dev/null | grep 'Context: \+rootless' || true)
3231

3332
function lookup_image_spec() {
3433
img_spec=$(python3 "${GIT_TOPLEVEL}/ci/jenkins/data.py" "$1")

0 commit comments

Comments
 (0)