Skip to content

Commit

Permalink
qa: display log message instead of raising an error if fontbakery rep…
Browse files Browse the repository at this point in the history
…ort cannot be posted. (#816)

* qa: display log message instead of raising an error if fontbakery report cannot be posted.

* rm unused import
  • Loading branch information
m4rc1e authored Jan 26, 2024
1 parent e4bdb2d commit 755a74f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Lib/gftools/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from gftools.gfgithub import GitHubClient
from gftools.utils import mkdir
import sys

try:
from diffenator2 import ninja_diff, ninja_proof
except ModuleNotFoundError:
Expand Down Expand Up @@ -167,7 +166,17 @@ def post_to_github(self, text):

client = GitHubClient(repo_owner, repo_name)

if issue_number:
client.create_issue_comment(issue_number, text)
else:
client.create_issue("Google Font QA report", text)
try:
if issue_number:
client.create_issue_comment(issue_number, text)
else:
client.create_issue("Google Font QA report", text)
except Exception as e:
logger.warn(
"Cannot post Fontbakery report!\n"
"Most likely, the repository may lack a GH_TOKEN secret, or "
"the pull request has come from a forked repo which "
"is not allowed to access the repo's secrets for "
f"security reasons. Full traceback:\n{e}"
)

0 comments on commit 755a74f

Please sign in to comment.