Skip to content

Commit

Permalink
AutoPR always using cherry-pick but do not resolve conflicts, just ke…
Browse files Browse the repository at this point in the history
…ep what it is and make PR, and able to simply edit PR to resolve conflicts manually (#707) (#708)

Co-authored-by: Coldwings <coldwings@me.com>
  • Loading branch information
photonlibos and Coldwings committed Feb 7, 2025
1 parent 984e7b6 commit c112ac4
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/auto-pr-precise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,16 @@ jobs:
echo "__EOF" >> $GITHUB_OUTPUT
REVS=$(git rev-list --reverse ${{ github.event.commits[0].id }}~..${{ github.event.after }} )
for rev in "$REVS"; do
if ! git cherry-pick -X theirs ${rev} ; then
echo "merge=false" >> $GITHUB_OUTPUT
exit 0;
if ! git cherry-pick ${rev} ; then
git add -u
git -c core.editor=true cherry-pick --continue
fi
done
git push -d origin ${{steps.create_branch.outputs.PRBRANCH}} || true
git push -u origin ${{steps.create_branch.outputs.PRBRANCH}}
echo "merge=true" >> $GITHUB_OUTPUT
- uses: actions/github-script@v7
name: Open pick PR to ${{steps.branch_info.outputs.NEXT_BRANCH}}
if: steps.merge-changes.outputs.merge == 'true'
with:
github-token: ${{ secrets.AUTOPR_SECRET }}
script: |
Expand All @@ -87,16 +85,3 @@ jobs:
body: `${{steps.merge-changes.outputs.MESSAGE}}\nGenerated by Auto PR, by cherry-pick related commits`,
});
- uses: actions/github-script@v7
name: Open merge PR to ${{steps.branch_info.outputs.NEXT_BRANCH}}
if: steps.merge-changes.outputs.merge == 'false'
with:
github-token: ${{ secrets.AUTOPR_SECRET }}
script: |
await github.rest.pulls.create({
...context.repo,
title: `[Merge][${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}] ${{steps.merge-changes.outputs.TITLE}}`,
head: `${context.ref}`,
base: `${{steps.branch_info.outputs.NEXT_BRANCH}}`,
body: `${{steps.merge-changes.outputs.MESSAGE}}\nGenerated by Auto PR, using merge since cherry-pick failed`,
});

0 comments on commit c112ac4

Please sign in to comment.