Skip to content

Conversation

@alan-agius4
Copy link
Contributor

When using the create-pr-for-changes workflow, old branches are not being deleted, and the content of superseded PRs remains open. This change ensures that:

  • Obsolete branches are deleted after PR creation.
  • Previously created PRs with outdated content are automatically closed.

Example: angular/angular#61203

When using the `create-pr-for-changes` workflow, old branches are not being deleted, and the content of superseded PRs remains open. This change ensures that:
- Obsolete branches are deleted after PR creation.
- Previously created PRs with outdated content are automatically closed.

Example: angular/angular#61203
@alan-agius4 alan-agius4 requested a review from devversion May 9, 2025 06:34
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: merge The PR is ready for merge by the caretaker labels May 9, 2025
}

// Gather PRs (if any) that will be superseded by the PR that will be created.
const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: We could simplify this logic, if we keep re-using the same branch (like renovate)

const {
data: {items: supersededPrs},
} = await git.github.search.issuesAndPullRequests({
advanced_search: 'true',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, when I read the commit description, I remembered that we already had logic for this in place. Is this just a fix because it didn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 9, 2025
@devversion devversion merged commit 3baae85 into angular:main May 9, 2025
9 checks passed
@alan-agius4 alan-agius4 deleted the branches branch May 9, 2025 07:16
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants