Skip to content

Commit

Permalink
add query
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-kt-inkeep committed Feb 14, 2024
1 parent 72067b4 commit 351ffcc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def main():
"variables": {"sourceId": source_id, "type": "INCREMENTAL"},
}

# query_payload = {
# "query": graphql_query,
# "variables": {"sourceId": source_id},
# }
query_payload = {
"query": graphql_query,
"variables": {"sourceId": source_id},
}

# Headers including the Authorization token
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
Expand All @@ -80,9 +80,11 @@ def main():
graphql_endpoint, headers=headers, json=json_payload
)

# query_response = requests.post(
# graphql_endpoint, headers=headers, json=query_payload
# )
query_response = requests.post(
graphql_endpoint, headers=headers, json=query_payload
)

display_name = query_response.json()["data"]["source"]["displayName"]

if mutation_response.status_code == 200:
gh = Github(os.getenv("GITHUB_TOKEN"))
Expand All @@ -95,7 +97,7 @@ def main():
print(f"No PR found for commit {sha}")
return

new_comment = f"![Inkeep Logo](https://storage.googleapis.com/public_inkeep_assetts/inkeep_logo_16h.png) [Inkeep](https://inkeep.com) AI search and chat service is syncing content for source '{source_id}'"
new_comment = f"![Inkeep Logo](https://storage.googleapis.com/public_inkeep_assetts/inkeep_logo_16h.png) [Inkeep](https://inkeep.com) AI search and chat service is syncing content for source '{display_name}'"

# Check for duplicated comment
old_comments = [c.body for c in pr.get_issue_comments()]
Expand Down

0 comments on commit 351ffcc

Please sign in to comment.