Skip to content

Commit

Permalink
Avoid failure when codecov did not process the data yet (#13)
Browse files Browse the repository at this point in the history
Fixes: #1
  • Loading branch information
ssbarnea committed Aug 14, 2024
1 parent fe90b7c commit 406626a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ repos:
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.6"
rev: "v0.5.7"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
4 changes: 3 additions & 1 deletion codecov-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
print(data, file=sys.stdout)
base_cov = 0.0
head_cov = 0.0
updatestamp = datetime.datetime.fromisoformat(data["updatestamp"])
updatestamp = start_time
if data["updatestamp"]: # can be None or a string
updatestamp = datetime.datetime.fromisoformat(data["updatestamp"])
if data["base_totals"] is not None:
base_cov = data["base_totals"]["coverage"]
if data["head_totals"] is not None:
Expand Down

0 comments on commit 406626a

Please sign in to comment.