Skip to content

Commit f25e09f

Browse files
authored
Fix for linearize_main for subsequent updates to automated commits (#7171)
This should fix the issue where merge conflicts exists in the automated commits json file. Bug: 409339952 Change-Id: I433e8b9372f0c45e2884377f8036751fea2dd23f
1 parent 98db8f1 commit f25e09f

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/linearize_main.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,14 @@ jobs:
5656
--start-commit-ref="$(git rev-parse --verify post-chrobalt-tag)" --end-commit-ref="$(git rev-parse --verify origin/automated/linear_main)" \
5757
--output-file=${GITHUB_WORKSPACE}/automated_commits_m114.json
5858
git add automated_commits_m114.json
59-
git commit -m "Linearization refresh on $(date +'%Y-%m-%d')."
60-
export CP_COMMIT="$(git rev-parse --verify HEAD)"
59+
git stash
6160
git checkout experimental/rebase_tools
62-
git cherry-pick --strategy=recursive -X theirs $CP_COMMIT
63-
git push --force origin experimental/rebase_tools:experimental/rebase_tools
61+
rm -rf automated_commits_m114.json
62+
git checkout stash -- automated_commits_m114.json
63+
git add --ignore-removal automated_commits_m114.json
64+
if git diff --quiet --cached; then
65+
echo "No changes detected. Nothing to update."
66+
else
67+
git commit -m "Linearization refresh on $(date +'%Y-%m-%d')."
68+
git push --force origin experimental/rebase_tools:experimental/rebase_tools
69+
fi

0 commit comments

Comments
 (0)