Skip to content

Commit

Permalink
Merge pull request anmol098#196 from mheob/194-show-commit-default-br…
Browse files Browse the repository at this point in the history
…anch

fix: use the default branch for getting commits
  • Loading branch information
anmol098 authored May 19, 2021
2 parents c2f40f0 + d573a4a commit 623866b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
createCommittedDateQuery = Template("""
query {
repository(owner: "$owner", name: "$name") {
ref(qualifiedName: "master") {
defaultBranchRef {
target {
... on Commit {
history(first: 100, author: { id: "$id" }) {
Expand Down Expand Up @@ -213,7 +213,7 @@ def generate_commit_list(tz):
result = run_query(
createCommittedDateQuery.substitute(owner=repository["owner"]["login"], name=repository["name"], id=id))
try:
committed_dates = result["data"]["repository"]["ref"]["target"]["history"]["edges"]
committed_dates = result["data"]["repository"]["defaultBranchRef"]["target"]["history"]["edges"]
for committedDate in committed_dates:
date = datetime.datetime.strptime(committedDate["node"]["committedDate"],
"%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.utc).astimezone(
Expand Down

0 comments on commit 623866b

Please sign in to comment.