

How I got Linus Torvalds in my contributors on GitHub
source link: https://dev.to/martiliones/how-i-got-linus-torvalds-in-my-contributors-on-github-3k4g
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.


How I got Linus Torvalds in my contributors on GitHub
Aug 25
・2 min read
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 :)
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.
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 ?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK