ci/update: fix re-apply commit order

We need to reverse the `rev-list` output so that the commits are
re-applied in the correct order; oldest first.
This commit is contained in:
Matt Sturgeon 2025-01-30 21:24:32 +00:00
parent d709c12cdd
commit 61fdbe2647
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -142,7 +142,7 @@ jobs:
remote="origin/$pr_branch"
author_rxp='^github-actions\[bot\] <41898282+github-actions\[bot\]@users\.noreply\.github\.com>$'
base=$(git rev-list --author="$author_rxp" --max-count=1 "$remote")
commits=( $(git rev-list "$base..$remote") )
commits=( $(git rev-list --reverse "$base..$remote") )
if [[ -n "$commits" ]]; then
echo "Applying ${#commits[@]} commits..."
echo "count=${#commits[@]}" >> $GITHUB_OUTPUT