Skip to content

Commit

Permalink
Use GITHUB_GRAPHQL_URL to get the graphql url
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Mar 15, 2021
1 parent e66abec commit 497f215
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions publish/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class Settings:
token: str
api_url: str
graphql_url: str
event: dict
event_name: str
repo: str
Expand Down Expand Up @@ -281,7 +282,7 @@ def get_pull_request_comments(self, pull: PullRequest) -> List[Mapping[str, Any]
)

headers, data = self._req.requestJsonAndCheck(
"POST", f'{self._settings.api_url}/graphql', input=query
"POST", self._settings.graphql_url, input=query
)

return data \
Expand All @@ -300,7 +301,7 @@ def hide_comment(self, comment_node_id) -> bool:
r'}'
)
headers, data = self._req.requestJsonAndCheck(
"POST", f'{self._settings.api_url}/graphql', input=input
"POST", self._settings.graphql_url, input=input
)
return data \
.get('data', {}) \
Expand Down
2 changes: 2 additions & 0 deletions publish_unit_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def get_settings(options: dict) -> Settings:
with open(event, 'r') as f:
event = json.load(f)
api_url = options.get('GITHUB_API_URL') or github.MainClass.DEFAULT_BASE_URL
graphql_url = options.get('GITHUB_GRAPHQL_URL') or f'{github.MainClass.DEFAULT_BASE_URL}/graphql'
test_changes_limit = get_var('TEST_CHANGES_LIMIT', options)
test_changes_limit = int(test_changes_limit) if test_changes_limit and test_changes_limit.isdigit() else 10

Expand All @@ -139,6 +140,7 @@ def get_settings(options: dict) -> Settings:
settings = Settings(
token=get_var('GITHUB_TOKEN', options),
api_url=api_url,
graphql_url=graphql_url,
event=event,
event_name=event_name,
repo=get_var('GITHUB_REPOSITORY', options),
Expand Down

0 comments on commit 497f215

Please sign in to comment.