Skip to content

Commit 717b382

Browse files
authored
Merge branch 'main' into zkoppert-hide-mentor-stats
2 parents c45c5db + b243bbf commit 717b382

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

.github/workflows/contributor_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo "END_DATE=$end_date" >> "$GITHUB_ENV"
2828
2929
- name: Run contributor action
30-
uses: github/contributors@9e9ce8e51fe186c4d699ebb3d35c1f1fd755a357 # v1.5.7
30+
uses: github/contributors@6949781e2a2575cba21a80325c9dd6014f5c898b # v1.5.8
3131
env:
3232
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333
START_DATE: ${{ env.START_DATE }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#checkov:skip=CKV_DOCKER_2
22
#checkov:skip=CKV_DOCKER_3
3-
FROM python:3.13-slim@sha256:21e39cf1815802d4c6f89a0d3a166cc67ce58f95b6d1639e68a394c99310d2e5
3+
FROM python:3.13-slim@sha256:914bf5c12ea40a97a78b2bff97fbdb766cc36ec903bfb4358faf2b74d73b555b
44
LABEL com.github.actions.name="issue-metrics" \
55
com.github.actions.description="Gather metrics on issues/prs/discussions such as time to first response, count of issues opened, closed, etc." \
66
com.github.actions.icon="check-square" \

labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_label_metrics(issue: github3.issues.Issue, labels: List[str]) -> dict:
5656

5757
# Calculate the time to add or subtract to the time spent in label based on the label events
5858
for event in label_events:
59-
# Skip labeling events that have occured past issue close time
59+
# Skip labeling events that have occurred past issue close time
6060
if issue.closed_at is not None and (
6161
event.created_at >= datetime.fromisoformat(issue.closed_at)
6262
):

search.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,33 +80,50 @@ def wait_for_api_refresh(
8080
if idx % issues_per_page == 0:
8181
wait_for_api_refresh(issues_iterator, rate_limit_bypass)
8282

83-
except github3.exceptions.ForbiddenError:
83+
except github3.exceptions.ForbiddenError as e:
8484
print(
8585
f"You do not have permission to view a repository \
8686
from: '{repos_and_owners_string}'; Check your API Token."
8787
)
88+
print_error_messages(e)
8889
sys.exit(1)
89-
except github3.exceptions.NotFoundError:
90+
except github3.exceptions.NotFoundError as e:
9091
print(
9192
f"The repository could not be found; \
9293
Check the repository owner and names: '{repos_and_owners_string}"
9394
)
95+
print_error_messages(e)
9496
sys.exit(1)
95-
except github3.exceptions.ConnectionError:
97+
except github3.exceptions.ConnectionError as e:
9698
print(
9799
"There was a connection error; Check your internet connection or API Token."
98100
)
101+
print_error_messages(e)
99102
sys.exit(1)
100-
except github3.exceptions.AuthenticationFailed:
103+
except github3.exceptions.AuthenticationFailed as e:
101104
print("Authentication failed; Check your API Token.")
105+
print_error_messages(e)
102106
sys.exit(1)
103-
except github3.exceptions.UnprocessableEntity:
107+
except github3.exceptions.UnprocessableEntity as e:
104108
print("The search query is invalid; Check the search query.")
109+
print_error_messages(e)
105110
sys.exit(1)
106111

107112
return issues
108113

109114

115+
def print_error_messages(error: github3.exceptions):
116+
"""Prints the error messages from the GitHub API response.
117+
118+
Args:
119+
Error (github3.exceptions): The error object from the GitHub API response.
120+
121+
"""
122+
if hasattr(error, "errors"):
123+
for e in error.errors:
124+
print(f"Error: {e.get('message')}")
125+
126+
110127
def get_owners_and_repositories(
111128
search_query: str,
112129
) -> List[dict]:

0 commit comments

Comments
 (0)