Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 25, 2021 02:54 pm GMT

How I got Linus Torvalds in my contributors on GitHub

Before starting, you can see for yourself by clicking on the link https://github.com/martiliones/icon-set-creator

* don't forget to star project if you like it :)

Idea

One day I wondered why my commits were not showing up in the activity overview. I googled and found on StackOverflow that GitHub uses your git email to link to the profile instead of the authentication data. So I thought that maybe I can change git email to get a commit from another user without his participation

Realisation

First of all, you need to get e-mail address of a target user. At first my idea was to get the email address from the user's git repository, but then I found that I could use the GitHub API to get it. Here is the GET API method you can run in your browser

https://api.github.com/users/REPLACE_WITH_USERNAME/events/public

You will get list of user events and you can easily find e-mail with search box in your browser (ctrl + F in most browsers, or if "Filter JSON" for Firefox)

Once we get the email address, we can create a commit:

git -c user.name='Linus Torvalds' -c user.email='[email protected]' commit -m "JavaScript is my favorite language "

To display your commits in target user Activity Overview at least one of the following must be true:

  • User is a collaborator on the repository or are a member of the organization that owns the repository.
  • User have forked the repository.
  • User have opened a pull request or issue in the repository.
  • User have starred the repository.

Results

You can do this with anyone as long as you have a user's email address.

Linus Torvalds commit

Contributors Graph

Conclusion

I think GitHub should fix this bug to prevent attacks on profiles. If the target user starred your repository, you can draw something in his Activity Overview as example

Thank you for your time. Share your opinion about it in the comments


Original Link: https://dev.to/martiliones/how-i-got-linus-torvalds-in-my-contributors-on-github-3k4g

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To