File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,11 @@ function github_get_libs_idf(){ # github_get_libs_idf <repo-path> <branch-name>
109
109
local libs_version=" "
110
110
111
111
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}' `
113
117
if [ ! " $version_found " == " " ] && [ ! " $version_found " == " null" ]; then
114
118
libs_version=$version_found
115
119
else
You can’t perform that action at this time.
0 commit comments