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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

$CONTRIBUTORS variable takes contributors from a skipped PR #569

Open
curquiza opened this issue Jun 18, 2020 · 12 comments
Open

$CONTRIBUTORS variable takes contributors from a skipped PR #569

curquiza opened this issue Jun 18, 2020 · 12 comments

Comments

@curquiza
Copy link

Hello everyone, thanks for your useful tool!!! 馃槃
In the meilisearch organization, we use release-drafter with GHA on most of our repositories for a few weeks and we are really satisfied!

I used to skip the PR of Dependabot thanks to the exclude-labels: field. It works perfectly: the PR is indeed not added to the release draft.

But the dependatbot contributor is still there.

Capture d鈥檈虂cran 2020-06-18 a虁 10 09 52

Is it possible to include only contributors from non-skipped PR in the $CONTRIBUTOR variable?

FYI, here is my template:

name-template: 'v$RESOLVED_VERSION 馃悕'
tag-template: 'v$RESOLVED_VERSION'
exclude-labels:
  - 'skip-changelog'
version-resolver:
  minor:
    labels:
      - 'breaking-change'
  default: patch
categories:
  - title: 'Breaking changes'
    label: 'breaking-change'
template: |
  ## Changes

  $CHANGES

  Thanks again to $CONTRIBUTORS! 馃帀
no-changes-template: 'Changes are coming soon 馃槑'
sort-direction: 'ascending'

Sorry if it's a duplicated issue but I found nothing.

Have a nice day!

@jetersen
Copy link
Member

jetersen commented Jun 18, 2020

for a quick workaround you could use the replacers to get rid of him 馃槄

@jetersen
Copy link
Member

This regex would mostly do the job: (?:and )?@dependabot-preview(?:\[bot\])?,?

@curquiza
Copy link
Author

curquiza commented Jun 18, 2020

Hello! @jetersen Thanks for your quick answer.
I tried this, but it does not work. I probably did something wrong.
My template:

name-template: 'v$RESOLVED_VERSION 馃悕'
tag-template: 'v$RESOLVED_VERSION'
exclude-labels:
  - 'skip-changelog'
version-resolver:
  minor:
    labels:
      - 'breaking-change'
  default: patch
categories:
  - title: 'Breaking changes'
    label: 'breaking-change'
template: |
  ## Changes

  $CHANGES

  Thanks again to $CONTRIBUTORS! 馃帀
no-changes-template: 'Changes are coming soon 馃槑'
sort-direction: 'ascending'
replacers:
  - search: '(?:and )?@dependabot-preview(?:\[bot\])?,?'
    replace: ''

The result:

Capture d鈥檈虂cran 2020-06-18 a虁 12 44 24

@jetersen
Copy link
Member

you have to write the full regex so:

replacers:
  - search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
    replace: ''

@curquiza
Copy link
Author

curquiza commented Jun 18, 2020

Of course 馃槄 ! Sorry!
Thanks, it works with your solution! 馃帀 !!

@jetersen
Copy link
Member

I'll look into fixing permanently

@ThomasKasene
Copy link
Contributor

ThomasKasene commented Jun 18, 2021

I was torn between creating a new issue or posting here, but could one solution be to introduce a new configuration property named exclude-authors or exclude-contributors? That way we (as repository owners and developers) can remove ourselves from the contributors list, which I think would be nice.

I've only thought this through for the $CONTRIBUTORS variable, and not the $AUTHOR variable - I'm not sure what I feel about that one yet.

@curquiza
Copy link
Author

curquiza commented Jun 21, 2021

Hello!
We use the release-drafter at the MeilISearch org in almost all of our repositories!
As you suggested @ThomasKasene, I would rather a exclude-contributors property rather than removing the contributors in the skipped PR from the $CONTRIBUTORS.
The current workaround works, but is not really perfect, there are issues with punctuations. We always have to redo manually the sentence before pushing. Not a big deal, I agree, but I would love to see this feature! 馃檪

@ssbarnea
Copy link
Contributor

Regex cleaning approach does not work when the undesired entry is at the end because the sentence will end like ... and. I doubt we can even properly do the cleanup using regexes.

I should also mention that the exclude-contributors does not seem to really work for bots at least. I added pre-commit-ci to the list and I still see two of them listed on the final output, very similar to the reported dependabot issue:

Kudos goes to: @cursedclock, @pre-commit-ci, @pre-commit-ci[bot], @rndmh3ro and @ssbarnea

@ThomasKasene
Copy link
Contributor

I'm not 100% but I don't think exclude-contributors has been released yet(?) As far as I can tell it was just merged with the master branch but nothing else. Correct me if I'm wrong.

@ssbarnea
Copy link
Contributor

That may explain it. It should also be noted that few days ago github updated the way release page displays by automatically creating a "contributors" section with badges of each contributor. You cannot disable this new section thus I fully removed the the similar feature from my release drafter template.

@AetherUnbound
Copy link

We're also seeing this as part of our monorepo-based deployment setup (borrowed from #1294) - on releases for a particular app, contributors of all commits (including those skipped) are added to $CONTRIBUTORS.

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

No branches or pull requests

5 participants