Skip to content

close-prs-for-unapproved-issues workflow does not close PRs linked to pre-existing issues #2252

Description

@batchu5

Describe the bug.

The three issue-approval workflows (issue-awaiting-approval.yml, issue-approve-command.yml, close-prs-for-unapproved-issues.yml) were all introduced in PR #2192. The auto-labelling workflow (issue-awaiting-approval.yml) only fires on issues: opened, so any issue created before that date never received the Awaiting Approval label.

The PR-closing workflow checks whether the linked issue has the Awaiting Approval label (line 76):

For pre-existing issues that have neither Awaiting Approval nor Approved Issue, this condition is false, so the PR stays open - bypassing the intended gate.

Proposed fix
Rather than checking if Awaiting Approval is present, we will check if the issue has the Approved Issue label. If yes, it keeps the pr open other wise closes that pr

Expected behavior

New PR's, which are linked to old issues, are closed even if the awaiting approval label is not there!

Screenshots

This pr is not closed, even though attached issue is not approved !!

Image

How to Reproduce

see the screenshot i have attached!

🖥️ Device Information [optional]

No response

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting ApprovalIssue awaiting maintainer approval before work can beginbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions