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

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

Open
balazsorban44 opened this issue Apr 23, 2021 · 1 comment · May be fixed by #360
Open

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

balazsorban44 opened this issue Apr 23, 2021 · 1 comment · May be fixed by #360

Comments

@balazsorban44
Copy link

balazsorban44 commented Apr 23, 2021

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

@markov00
Copy link

markov00 commented Nov 3, 2021

Any update on this? It becomes really annoying in particular in some cases like the following elastic/elastic-charts#1108 (comment)
where we have dozen of successful release comments
I saw the #360 PR I hope it can go through and be merged soon, if not we should probably just disable the successComment as a workaround
Thanks

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 a pull request may close this issue.

2 participants