Skip to content

Commit 715dac4

Browse files
committed
Merge branch 'master' into release/v5.1
2 parents f0ba74e + aa44cb2 commit 715dac4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/config.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ function github_get_libs_idf(){ # github_get_libs_idf <repo-path> <branch-name>
109109
local libs_version=""
110110

111111
while [ "$libs_version" == "" ]; do
112-
version_found=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/commits?sha=$branch_name&per_page=100&page=$page" | jq -r '.[].commit.message' | grep -Eo "$message_prefix [a-f0-9]{8}" | awk 'NR==1{print $NF}'`
112+
# Get the latest commit message that matches the prefix and extract the hash from the last commit message
113+
version_found=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/commits?sha=$branch_name&per_page=100&page=$page" | \
114+
jq -r --arg prefix "$message_prefix" '[ .[] | select(.commit.message | test($prefix + " [a-f0-9]{8}")) ][0] | .commit.message' | \
115+
grep -Eo "$message_prefix [a-f0-9]{8}" | \
116+
awk 'END {print $NF}'`
113117
if [ ! "$version_found" == "" ] && [ ! "$version_found" == "null" ]; then
114118
libs_version=$version_found
115119
else

0 commit comments

Comments
 (0)