mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
ci: validate the chip submodule in readme
This commit is contained in:
+17
-1
@@ -154,13 +154,29 @@ build_image:
|
||||
script:
|
||||
- cd ${ESP_MATTER_PATH}
|
||||
- chip_head_commit=$(git rev-parse HEAD:connectedhomeip/connectedhomeip)
|
||||
- chip_head_in_readme=$(awk -F'[][]' '/commit \[.* of connectedhomeip/{print $2}' README.md)
|
||||
|
||||
# Check both conditions and collect errors
|
||||
- commit_validation_error=0
|
||||
- |
|
||||
if echo "$chip_head_commit" | grep -q "^${chip_head_in_readme}"; then
|
||||
echo "README.md is not in sync with the connectedhomeip submodule"
|
||||
else
|
||||
echo "Please update the README.md file with the latest commit hash of the connectedhomeip submodule"
|
||||
commit_validation_error=1
|
||||
fi
|
||||
|
||||
- |
|
||||
if echo "${chip_head_commit}" | grep -q "^${CHIP_SHORT_HASH}"; then
|
||||
echo "The CHIP_SHORT_HASH variable is set to correct value. Matches with current head commit"
|
||||
else
|
||||
echo "The CHIP_SHORT_HASH seems to be incorrect or you have updated the submodule but not the CHIP_SHORT_HASH variable above"
|
||||
exit 1
|
||||
commit_validation_error=1
|
||||
fi
|
||||
|
||||
# Exit with collected error status
|
||||
- if [ $commit_validation_error -ne 0 ]; then exit 1; fi
|
||||
|
||||
- TAG="chip_${CHIP_SHORT_HASH}_idf_${IDF_VERSION}"
|
||||
- echo $TAG
|
||||
- |
|
||||
|
||||
Reference in New Issue
Block a user