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

Open Beginner friendly
#2,252 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions
Domain
ci-cd

Research direction

Start with .github/workflows/close-prs-for-unapproved-issues.yml, especially the condition at line 76, and review how the workflow identifies labels on linked issues. Verify the behavior for a PR linked to a pre-existing issue without approval labels and for one with the Approved Issue label. Done means unapproved linked PRs are closed while approved ones remain open.

Written by the indexing model from the issue text.

Description

Awaiting Approval bug
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!

Dominant language
JavaScript
Stars
1.1k
Forks
396
Avg merge
1d 18h
Merged PRs (30d)
26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from asyncapi/generator

All issues in asyncapi/generator

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.