Relax update preciseness (#9758)

automerge
This commit is contained in:
Ryo Onodera 2020-04-28 17:40:25 +09:00 committed by GitHub
parent a61904b2dc
commit ef7196cec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -10,14 +10,25 @@ parsed_update_args="$(
grep -o 'Bump.*$' |
sed -r 's/Bump ([^ ]+) from ([^ ]+) to ([^ ]+)/-p \1:\2 --precise \3/'
)"
# relaxed_parsed_update_args is temporal measure...
relaxed_parsed_update_args="$(
git log "$commit_range" --author "dependabot-preview" --oneline -n1 |
grep -o 'Bump.*$' |
sed -r 's/Bump ([^ ]+) from [^ ]+ to ([^ ]+)/-p \1 --precise \2/'
)"
package=$(echo "$parsed_update_args" | awk '{print $2}' | grep -o "^[^:]*")
if [[ -n $parsed_update_args ]]; then
# find other Cargo.lock files and update them, excluding the default Cargo.lock
# shellcheck disable=SC2086
for lock in $(git grep --files-with-matches '^name = "'$package'"$' :**/Cargo.lock); do
# it's possible our current versions are out of sync across lock files,
# in that case try to sync them up with $relaxed_parsed_update_args
_ scripts/cargo-for-all-lock-files.sh \
"$lock" -- \
update $parsed_update_args
update $parsed_update_args ||
_ scripts/cargo-for-all-lock-files.sh \
"$lock" -- \
update $relaxed_parsed_update_args
done
fi