mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
ci/check-cherry-picks: improve error handling
We recently moved the $commits variable out of a "subshell in a herestring", let's do the same for the list of branches, where errors would be silently swallowed as well. Also reformat the expressions slightly, we have enough line-length.
This commit is contained in:
parent
ad4b36d2d2
commit
e2a3792169
1 changed files with 4 additions and 8 deletions
|
@ -14,9 +14,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
|
|||
PICKABLE_BRANCHES=${PICKABLE_BRANCHES:-master staging release-??.?? staging-??.??}
|
||||
problem=0
|
||||
|
||||
commits="$(git rev-list \
|
||||
-E -i --grep="cherry.*[0-9a-f]{40}" --reverse \
|
||||
"$1..$2")"
|
||||
commits="$(git rev-list -E -i --grep="cherry.*[0-9a-f]{40}" --reverse "$1..$2")"
|
||||
|
||||
while read new_commit_sha ; do
|
||||
if [ -z "$new_commit_sha" ] ; then
|
||||
|
@ -45,6 +43,8 @@ while read new_commit_sha ; do
|
|||
for branch_pattern in $PICKABLE_BRANCHES ; do
|
||||
set +f # re-enable pathname expansion
|
||||
|
||||
branches="$(git for-each-ref --format="%(refname)" "refs/remotes/origin/$branch_pattern")"
|
||||
|
||||
while read -r picked_branch ; do
|
||||
if git merge-base --is-ancestor "$original_commit_sha" "$picked_branch" ; then
|
||||
echo " ✔ $original_commit_sha present in branch $picked_branch"
|
||||
|
@ -79,11 +79,7 @@ while read new_commit_sha ; do
|
|||
# move on to next commit
|
||||
continue 3
|
||||
fi
|
||||
done <<< "$(
|
||||
git for-each-ref \
|
||||
--format="%(refname)" \
|
||||
"refs/remotes/origin/$branch_pattern"
|
||||
)"
|
||||
done <<< "$branches"
|
||||
done
|
||||
|
||||
if [ "$GITHUB_ACTIONS" = 'true' ] ; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue