Skip to content

Commit

Permalink
fix(pr-comment-ci): process completed with exit code 1
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Aug 7, 2024
1 parent c13dc99 commit 11954b3
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/pr-comment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,37 @@ jobs:
common_conflict=$(git status | grep 'both modified:' | grep -c '_common')
conflicts_sum=$((csr_snap_conflict + ssr_snap_conflict + common_conflict))
echo "conflict_count: $conflict_count"
echo "working_tree_clean: $working_tree_clean"
echo "csr_snap_conflict: $csr_snap_conflict"
echo "ssr_snap_conflict: $ssr_snap_conflict"
echo "common_conflict: $common_conflict"
echo "conflicts_sum: $conflicts_sum"
if [ "$working_tree_clean" -eq "1" ]; then
echo "nothing to commit, working tree clean"
exit 0
echo "nothing to commit, working tree clean"
exit 0
fi
if [ "$conflict_count" -gt "0" ]&&[ "$conflicts_sum" -eq "0" ]; then
echo "Unknown conflict "
git status
exit 1
echo "Unknown conflict "
git status
exit 1
fi
if [ "$csr_snap_conflict" -eq "1" ];then
git checkout --theirs test/snap/__snapshots__/csr.test.jsx.snap
git checkout -f develop test/snap/__snapshots__/csr.test.jsx.snap
echo "resolve conflict csr.test.jsx.snap"
fi
if [ "$ssr_snap_conflict" -eq "1" ];then
git checkout --theirs test/snap/__snapshots__/ssr.test.jsx.snap
git checkout -f develop test/snap/__snapshots__/ssr.test.jsx.snap
echo "resolve conflict ssr.test.jsx.snap"
fi
if [ "$common_conflict" -eq "1" ];then
git checkout --theirs src/_common
git checkout -f develop src/_common
echo "resolve conflict _common"
fi
git commit -am "chore: merge develop"
Expand Down

0 comments on commit 11954b3

Please sign in to comment.