Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: close previous update PRs when a new one is generated #142

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

rriski
Copy link
Contributor

@rriski rriski commented Sep 25, 2024

About this change - What it does

Close previous PRs created by this workflow when a new one is created. Example run:

Run new_pr_number=148
  
✓ Closed pull request aiven/go-client-codegen#147 (chore(update): bump openapi schema (2024-09-25))
! Skipped deleting the local branch since current directory is not a git repository 
✓ Deleted branch update/2024-09-25

Comment is added to the previous PR referencing the new PR: #147 (comment)

PR list before:

go-client-codegen-PRs-before

PR list after:

go-client-codegen-PRs-after

Why this way

The action is ran every day on a cron schedule, and if the update from yesterday wasn't merged, we'd have two PRs open. The previous one would have to be closed manually.

@rriski rriski force-pushed the rriski-close-previous-update-prs branch from 390e328 to fc32bf2 Compare September 25, 2024 07:29
@rriski rriski marked this pull request as ready for review September 25, 2024 07:34
@rriski rriski requested a review from a team as a code owner September 25, 2024 07:34
@rriski rriski force-pushed the rriski-close-previous-update-prs branch 2 times, most recently from 5989227 to 0972a56 Compare September 25, 2024 08:01
Copy link

@Echie Echie left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@rriski rriski merged commit 0c07813 into main Sep 25, 2024
7 checks passed
@rriski rriski deleted the rriski-close-previous-update-prs branch September 25, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants