Skip to content

Commit

Permalink
Merge pull request #19183 from nsoranzo/release_24.0_check_base_ref_c…
Browse files Browse the repository at this point in the history
…hanged

[24.0] Update title of edited PRs only if base ref changed
  • Loading branch information
jdavcs authored Nov 22, 2024
2 parents 46c1dcd + 09d8695 commit d59f7a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr-title-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: Update PR title

on:
pull_request_target:
types: [opened, edited]
types: [opened, edited, reopened]
branches:
- "release_**"

jobs:
update-title:
if: github.event.action != 'edited' || github.event.changes.base.ref.from != ''
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Update PR title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -23,5 +23,5 @@ jobs:
VERSION=$(echo $TARGET_BRANCH | grep -oP '\d+\.\d+')
if [[ -n "$VERSION" && ! "$PR_TITLE" =~ ^\[$VERSION\] ]]; then
NEW_TITLE="[$VERSION] $PR_TITLE"
gh pr edit $PR_NUMBER --title "$NEW_TITLE"
gh pr edit $PR_NUMBER --repo "${{ github.repository }}" --title "$NEW_TITLE"
fi

0 comments on commit d59f7a6

Please sign in to comment.