Is it possible to view private events within a team repo? - github

Been playing around with the Github v3 API.
I was wondering if it was possible to see private events within a team repository I belong to if I am authenticated.
I see on the docs that with the /users/:username/events endpoint, it'll only show your own private events. Is there a way around this?
Thanks!

I think if you are authenticated the GET /repos/:owner/:repo/events endpoint will do what you expect - see events associated with a repository.
Documentation: https://developer.github.com/v3/activity/events/#list-repository-events
There are also repository issue events GET /repos/:owner/:repo/issues/events which are a slightly different format.
Documentation: https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository

Related

How to submit website feedback to GitHub?

I want to make a page on my website containing the information form for the bug they faced while using the website and web application.
Then I want to show those feedback to my private GitHub repository, so that I can keep track of all the bugs and work on fixing them.
Is there any GitHub API for this purpose?
Using the GitHub API (like suggested in the other answer) is a possible solution, but requires you to implement the UI by yourself, call the API with proper authentication etc. etc.
If you want a simpler solution with less work for you, you could point your users directly from your website to your GitHub issue tracker.
Unfortunately, GitHub doesn't support private repositories with public issues. Their official solution for this problem is to
create a second (public) repo and use this just to host the public issues.
If changing your hosting provider is an option for you, you could migrate your project to Bitbucket.
They offer unlimited private repos for free if you have max. five users, and it's possible to have a private repo with a public issue tracker.
Quote from the last link:
Users with administrative rights on a repository can set a Bitbucket
Cloud issue tracker as private or public. When your tracker is
public, anyone can view, create, and comment on issues it contains.
This includes people who land on the website but who do not have a
Bitbucket account. The system asks these users to verify they are
people with a CAPTCHA.
You can set your Bitbucket repository, wiki,
and issue tracker as private or public, independently of each other.
For example, you can hide your code from the world by setting your
repository as private, but let people see your documentation and
issues by marking your wiki and issue tracker as public. Or you could
set your repository and wiki as public but keep your issue tracker
private. You can change any of these settings from private to public,
or public to private, at any time.
GitHub does have an API and one if its end-points is for creating bugs:
https://developer.github.com/v3/issues/
Well, https://github.com/tan-tan-kanarek/github-php-client this worked like a charm for me. In my scenario, I was working in phalcon framework and I used this API to submit issue to a private GitHub repository.
Authentication is pretty simple in this API .

How can I add a participant to an Issue through the GitHub API?

I'm looking for a way to add a list of participants to a GitHub Issue using the GitHub API.
I have tried:
Assigning the issue through the GitHub API.
Works, adding participants, but may be too direct, and there is a limit of 10 assignees.
#mentioning users in the description and a comment.
Does not add participants
My end goal here is to create an issue representing an deploy and #mention everyone who has a PR being deployed so that they know to help test. I'd like everyone to get a GitHub notification about the issue as it is created. Adding them to the list of participants seems like it should be the best way to accomplish this.

Github Webhooks for Public Repo Creation

Is it possible to set up a Webhook to notify me every time a new repo is created on the whole public environment of Github (not limited to an specific organisation)?
No, not possible currently. If you'd like to share your use-case for this, please get in touch with us: https://github.com/contact

Is it possible to add webhooks to a gist?

Basically, the same way as I can set up a push webhook for a Github repo, can I set it up for a Github gist? I looked around, and I suspect not since there's no documentation for it.
If it is impossible, is there anyway to get notifications whenever a gist is updated? If not, I'm ready to implement a solution that polls every few minutes, but I prefer the notification based solution.
Well, I confirmed it for myself. Github doesn't allow any kind of code to be run on its server's during/before/after a push, so it has webhooks for developers to take advantage of that. Gist does not support either actual Git hooks or Github webhooks.
is there anyway to get notifications whenever a gist is updated?
Since May 8th, 2019, it is possible.
See "Gist notifications "
You can now receive notifications for new conversations occurring on gists. Similar to issues and pull requests, you can opt out of these notifications at any time.
The documentation now includes:
Receiving notifications for gist activity
You'll receive a notification when:
You are the author of the gist.
Someone mentions you in a gist.
You comment in another persons's gist.
You subscribe to a gist, by clicking Subscribe at the top any gist.
In your case, maybe you can combine that with GitHub Actions, which does allow some code execution on the server side, including some involving notification.

How can I track current Follow/Unfollow events on Github API?

Github API V3 Documenatation states:
FollowEvent
Triggered when a user follows another user.
Events of this type are no longer created, but it’s possible that they
exist in timelines of some users.
Beside of wondering why those events are not being created, is there other way I can track when and who does user decide follow (and unfollow) through the github API?
The only other API I can think of around this is the List users followed by another user endpoint, but that won't give you timestamps and unfollow events - you'd have to do that work yourself...