Skip to content

Commit

Permalink
add a helpful perm warning to 403 errors (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Sep 11, 2023
1 parent 4e2dfa4 commit a231964
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tagbot/action/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ def create_release(self, version: str, sha: str) -> None:
def handle_error(self, e: Exception) -> None:
"""Handle an unexpected error."""
allowed = False
internal = True
trace = traceback.format_exc()
if isinstance(e, RequestException):
logger.warning("TagBot encountered a likely transient HTTP exception")
Expand All @@ -600,8 +601,17 @@ def handle_error(self, e: Exception) -> None:
logger.warning("GitHub returned a 5xx error code")
logger.info(trace)
allowed = True
elif e.status == 403:
logger.error(
"""GitHub returned a 403 permissions-related error.
Please check that your ssh key and TagBot permissions are up to date
https://github.com/JuliaRegistries/TagBot#setup
"""
)
internal = False
if not allowed:
logger.error("TagBot experienced an unexpected internal failure")
if internal:
logger.error("TagBot experienced an unexpected internal failure")
logger.info(trace)
try:
self._report_error(trace)
Expand Down

0 comments on commit a231964

Please sign in to comment.