knl / niv-updater-action

A GitHub Action that creates meaningful pull requests with updates to your niv-managed dependencies, so you don't have to do menial chores.
BSD 3-Clause "New" or "Revised" License
29 stars 11 forks source link

Strip mentions from the pull request message #26

Closed utdemir closed 4 years ago

utdemir commented 4 years ago

First, thanks for creating niv-updater-action, it is very convenient.

I have niv-updater-action running on my dotfiles repository, sending PR's every week. nixpkgs is one of the dependencies.

Turns out, the nixpkgs commit messages tend to include references to issues/pr's on nixpkgs repository, for example:

2020-05-23-162315_584x175_scrot

This means that every time niv-updater-action sends a PR my repository, GitHub will mention that PR in the mentioned issue; but most of the times, it'll be a nuisance on nixpkgs. It looks like this is already happening on the wild:

From: https://github.com/NixOS/nixpkgs/pull/76994 (I know that I'm adding yet another mention here) 2020-05-23-162557_728x501_scrot

In order to keep the nixpkgs issues clean, it would be great for niv-updater-action to somehow strip those mentions by default.

I'm not sure what would be the best way to do it, I guess we can either have a postprocessing step on the commit message removing/escaping the mention-causing phrases, or we can just wrap the each commit message in code blocks.

infinisil commented 4 years ago

The same for usernames, e.g. see https://github.com/JJJollyjim/arewehackersyet/pull/6 where @deliciouslytyped is being pinged since a commit subjects mentions them

nomeata commented 4 years ago

I find these links very useful (and actualy asked for the rewriting to make them possible – just leaving them as #123 would link to the wrong repo).

Maybe there is a way to have a link that doesn't trigger Github’s backlinking? Not according to https://github.community/t/linking-to-an-issue-without-creating-a-reference/890/3

Is there a generic URL redirection service out there that the link could be wrapped in?

https://www.google.com/url?sa=t&url=https://github.com… might work, as in: this test.

utdemir commented 4 years ago

@nomeata

Is there a generic URL redirection service out there that the link could be wrapped in?

I think that is a good idea.

DuckDuckGo's one seems to work, try: http://r.duckduckgo.com/l/?uddg=https://github.com

knl commented 4 years ago

Hi all, I'll take a look at this issue and submit a PR tomorrow. Sorry for such a late response, I never got a notification from GitHub that there is an open issue :(

knl commented 4 years ago

@utdemir I created #29 to fix this issue, thanks for your patience. Would that work for you?

knl commented 4 years ago

The same for usernames, e.g. see JJJollyjim/arewehackersyet#6 where @deliciouslytyped is being pinged since a commit subjects mentions them

@Infinisil I created https://github.com/knl/niv-updater-action/pull/31 to fix the issue you brought up.