Skip to content

Commit 4e2d150

Browse files
committed
Merge branch 'ci_chip_commit_validations' into 'main'
ci: validate the chip submodule in readme See merge request app-frameworks/esp-matter!959
2 parents 280f514 + d6ddc85 commit 4e2d150

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.gitlab-ci.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,29 @@ build_image:
154154
script:
155155
- cd ${ESP_MATTER_PATH}
156156
- chip_head_commit=$(git rev-parse HEAD:connectedhomeip/connectedhomeip)
157+
- chip_head_in_readme=$(awk -F'[][]' '/commit \[.* of connectedhomeip/{print $2}' README.md)
158+
159+
# Check both conditions and collect errors
160+
- commit_validation_error=0
161+
- |
162+
if echo "$chip_head_commit" | grep -q "^${chip_head_in_readme}"; then
163+
echo "README.md is not in sync with the connectedhomeip submodule"
164+
else
165+
echo "Please update the README.md file with the latest commit hash of the connectedhomeip submodule"
166+
commit_validation_error=1
167+
fi
168+
157169
- |
158170
if echo "${chip_head_commit}" | grep -q "^${CHIP_SHORT_HASH}"; then
159171
echo "The CHIP_SHORT_HASH variable is set to correct value. Matches with current head commit"
160172
else
161173
echo "The CHIP_SHORT_HASH seems to be incorrect or you have updated the submodule but not the CHIP_SHORT_HASH variable above"
162-
exit 1
174+
commit_validation_error=1
163175
fi
176+
177+
# Exit with collected error status
178+
- if [ $commit_validation_error -ne 0 ]; then exit 1; fi
179+
164180
- TAG="chip_${CHIP_SHORT_HASH}_idf_${IDF_VERSION}"
165181
- echo $TAG
166182
- |

0 commit comments

Comments
 (0)