Skip to content

Filter PR/Issue that should get a comment on success #359

Closed
@balazsorban44

Description

@balazsorban44

First I would like to describe my problem, and try to come with a suggestion:
Originally posted at: semantic-release/semantic-release#1603
but posting here as it seems more fit:

so to get our prerelease (next) branch up-to-date, I did as you suggested, and merged our main/latest branch into it. Now semantic-release sent out a comment to ALL minor bugfix issues/PRs made to the main - those have already been closed and released - when it published a new next release 👀. Is it possible to avoid that somehow? Those changes have already been released, why semantic-release is so eager to comment/send out notifications on those again? 😕
It now generated over 100 comments on already closed/handled issues, and I have no idea why. 😢
Will those be re-released a third time now when I merge them back to main? 😨
The repo in question: https://github.com/nextauthjs/next-auth
Our config is fairly simple:

"release": {
 ​"branches": [
   ​"+([0-9])?(.{+([0-9]),x}).x",
   ​"main",
   ​{
     ​"name": "beta",
     ​"prerelease": true
   ​},
   ​{
     ​"name": "next",
     ​"prerelease": true
   ​}
 ​]
},

Is there any configuration that could prohibit semantic-release to dig up already closed/merged labeled/commented issues/PRs, and only comment/label those that haven't been done so before? 🤔

If currently there is no way of achieving this, here is my suggestion:

I studied the following file:

https://github.com/semantic-release/github/blob/master/lib/success.js

And it would be nice to have an option to filter the issues/prs, before sending out a comment, something like this:

successFilter: (pr) => !pr.labels.some(label => label.name.includes("released"))

This should restrict the PRs to only those that don't have a label yet containing "released"

Ref: https://docs.github.com/en/rest/reference/search#search-issues-and-pull-requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions