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

Commit author's name link is incorrect #158

Closed
jfix opened this issue Apr 7, 2018 · 3 comments · Fixed by #175
Closed

Commit author's name link is incorrect #158

jfix opened this issue Apr 7, 2018 · 3 comments · Fixed by #175

Comments

@jfix
Copy link

jfix commented Apr 7, 2018

I've just started using gren so maybe this is just bad usage on my part.

I've configured gren with the CLI (very nice 👍), and this is the config file:

---
  dataSource: "commits"
  prefix: ""
  includeMessages: "all"
  changelogFilename: "CHANGELOG.md"

I've generated the Changelog for an existing release via gren release --override. While this works well, I've noticed that each list item ends with the author name which is supposed to be clickable. I don't know why, but in my case, it uses my name, "Jakob Fix", instead of my id, @jfix. Therefore, because of the prefixed @ it makes the first name, @jakob, clickable, which is another Github user.

Here's an example from the CHANGELOG.md file which I also generated using gren changelog --override:

- [✨ Replace `electron-json-storage` with `electron-store` (dot notation!).](https://api.github.com/repos/jfix/pac-toolkit/git/commits/3a65f60133ea288e294266e69a26875af6ea4df6) - @Jakob Fix

I've added the configuration option username: "jfix" to the configuration file, hoping this would change things, but to no avail, unfortunately.

Here is the release: https://github.com/jfix/pac-toolkit/releases/tag/v1.1.0

@alexcanessa
Copy link
Member

alexcanessa commented Apr 12, 2018

Hey @jfix, thanks for your feedback.

This one can be easily tackled by changing what gets passed to the template.

_templateCommits({ sha, html_url, commit: { author: { name }, message } }) {
return generate({
sha,
message: message.split('\n')[0],
url: html_url,
author: name
}, this.options.template.commit);
}

The information should come directly from author.login

//see https://developer.github.com/v3/repos/commits/#get-a-single-commit

"author": {
    "login": "octocat"

@mariotacke
Copy link
Contributor

Just ran into the same thing and some other person showed up in my release notes... 💩 Has anyone taken this one on yet? In the meantime I manually fixed my release notes.

mariotacke added a commit to mariotacke/github-release-notes that referenced this issue Jun 16, 2018
GitHub markdown converts @-references with links to user profiles. Using
the full author name means potentially including a space which breaks this
linking behavior. Instead of the author name (Ex: Mario Tacke), this fix
uses the author login (Ex: mariotacke) to form a proper link in the
release notes and changelog).

This fixes github-tools#158
alexcanessa pushed a commit that referenced this issue Jun 18, 2018
GitHub markdown converts @-references with links to user profiles. Using
the full author name means potentially including a space which breaks this
linking behavior. Instead of the author name (Ex: Mario Tacke), this fix
uses the author login (Ex: mariotacke) to form a proper link in the
release notes and changelog).

This fixes #158
@alexcanessa
Copy link
Member

This is actually still a bug as the author we're looking for doesn't belong to commit.

See: https://api.github.com/repos/github-tools/gren-tester/commits/2235967d392fb3822c4a9a9f908d18d80a541268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants