Skip to content

Commit

Permalink
add first WIP for allowing to get stats about created releases
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Aug 24, 2023
1 parent 101d208 commit 6764221
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions did/plugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
url = https://api.github.com/
token = <authentication-token>
login = <username>
project = <project1, project2>
The authentication token is optional. However, unauthenticated
queries are limited. For more details see `GitHub API`__ docs.
Expand Down Expand Up @@ -217,6 +218,16 @@ def fetch(self):
self.stats = [
Issue(issue) for issue in self.parent.github.search(query)]

class ReleasesCreated(Stats):
""" Releases created """

def fetch(self):
for project in self.user.projects:
log.info("Searching for releases created by {0} in {1}".format(self.user, project))
query = "repos/{0}/releases?q=author:{1}+created:{2}..{3}".format(
project, self.user.login, self.options.since, self.options.until)
self.stats = [
Releases(release) for release in self.parent.github.search(query)]

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stats Group
Expand Down

0 comments on commit 6764221

Please sign in to comment.