Skip to content

Commit

Permalink
Let auto-pr title contain more information
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 authored and lihuiba committed Dec 17, 2024
1 parent e5812d8 commit 4fa4d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/auto-pr-precise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ jobs:
git checkout ${{steps.branch_info.outputs.NEXT_BRANCH}}
git checkout -b ${{steps.create_branch.outputs.PRBRANCH}}
echo "MESSAGE<<__EOF" >> $GITHUB_OUTPUT
git log --format=%B ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT
TITLE=$(git log --format="| %s" ${{ github.event.commits[0].id }}~..${{ github.event.after }} | xargs)
echo "TITLE=$TITLE" >> $GITHUB_OUTPUT
git log --format="> %b" ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT
echo "__EOF" >> $GITHUB_OUTPUT
REVS=$(git rev-list --reverse ${{ github.event.commits[0].id }}~..${{ github.event.after }} )
for rev in "$REVS"; do
Expand All @@ -78,7 +80,7 @@ jobs:
script: |
await github.rest.pulls.create({
...context.repo,
title: `Pick ${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}`,
title: `[${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}] ${{steps.create_branch.outputs.TITLE}}`,
head: `${{steps.create_branch.outputs.PRBRANCH}}`,
base: `${{steps.branch_info.outputs.NEXT_BRANCH}}`,
body: `${{steps.merge-changes.outputs.MESSAGE}}\nGenerated by Auto PR, by cherry-pick related commits`,
Expand All @@ -92,7 +94,7 @@ jobs:
script: |
await github.rest.pulls.create({
...context.repo,
title: `Merge ${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}`,
title: `[${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}] ${{steps.create_branch.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`,
Expand Down
File renamed without changes.

0 comments on commit 4fa4d42

Please sign in to comment.