mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-29 10:17:30 +02:00
ci(common): Update component version only if tag doesn't exist
If the merged PR is a few commits behind master, the merge commit could show changes in the version files as well. This fix checks if the version already exists and updates the envirionment only if the tag is not present.
This commit is contained in:
@ -9,7 +9,7 @@ fi
|
||||
|
||||
for comp in `ls components`; do
|
||||
if git log -1 -m --name-only --pretty="" | grep -q components/${comp}/idf_component.yml; then
|
||||
echo "${comp}: Component version has been updated"
|
||||
echo "${comp}: Component version file has changed"
|
||||
version=`grep version: components/${comp}/.cz.yaml`
|
||||
version=${version#*version: }
|
||||
|
||||
@ -17,7 +17,11 @@ if git log -1 -m --name-only --pretty="" | grep -q components/${comp}/idf_compon
|
||||
tag_format=${tag_format#*tag_format: }
|
||||
|
||||
eval tag=$tag_format
|
||||
|
||||
# check if the tag is already created
|
||||
if [ $(git tag -l "$tag") ]; then
|
||||
echo "${comp}: version (${tag}) already exits"
|
||||
else
|
||||
echo "${comp}: Component version has been updated to ${version}"
|
||||
# creates release notes from the last entry (between first two "## sections")
|
||||
awk '/^## \[/{a++};{if(a==1){print}}' components/${comp}/CHANGELOG.md > release_notes.md
|
||||
|
||||
@ -31,6 +35,7 @@ if git log -1 -m --name-only --pretty="" | grep -q components/${comp}/idf_compon
|
||||
echo "BUMP_TAG=${tag}" >> "$GITHUB_ENV"
|
||||
|
||||
exit 0;
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "No changes in component version file"
|
||||
|
Reference in New Issue
Block a user