Skip to content

fix: skip closed pull requests so they stay in Closed - #70

Merged
markubra merged 3 commits into
mainfrom
fix/skip-closed-pull-requests
Sep 30, 2026
Merged

markubra merged 3 commits into
mainfrom
fix/skip-closed-pull-requests

Conversation

@markubra

Copy link
Copy Markdown

Closing a PR makes github-webhooks set it to "Closed" and then re-run this action, which sets the team board status back to "Pull Request" a few seconds later (e.g. apify/apify-infra#1575).

  • Return early for closed PRs, after closing the issues a merged PR references
  • Read the state from a fresh fetch, since a re-run replays the original event payload where the PR is still open

@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Sep 29, 2026
@apify-service-account apify-service-account added the t-infra Issues with this label are in the ownership of the infrastructure team. label Sep 29, 2026
@markubra markubra added the adhoc Ad-hoc unplanned task added during the sprint. label Sep 29, 2026
Comment on lines +84 to +90
/**
* Checks whether the pull request is closed, merged or not.
*/
public async isClosed(): Promise<boolean> {
const pullRequest = await this.getPullRequest();
return pullRequest.state === 'closed';
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so if it's merged instead of closed, how does this one behave please?

@markubra markubra Sep 30, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Merged PRs have state: closed in the REST API, so this returns true for both. Issue closing for merged PRs runs before this check

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds good, can you please extend the docstring so it explains this?

@markubra
markubra requested a review from gippy September 30, 2026 12:19
@markubra
markubra merged commit b221774 into main Sep 30, 2026
3 checks passed
@markubra
markubra deleted the fix/skip-closed-pull-requests branch September 30, 2026 12:56
@fnesveda

fnesveda commented Oct 5, 2026

Copy link
Copy Markdown
Member

Thanks for the fix guys! I didn't think of this situation originally, my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-infra Issues with this label are in the ownership of the infrastructure team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants