-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathlocal.py
More file actions
39 lines (26 loc) · 840 Bytes
/
local.py
File metadata and controls
39 lines (26 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import subprocess
from codecov_cli.helpers.ci_adapters.base import CIAdapterBase
SUCCESS = 0
class LocalAdapter(CIAdapterBase):
def detect(self) -> bool:
s = subprocess.run(["git", "help"], capture_output=True)
return s.returncode == SUCCESS
def _get_branch(self):
return os.getenv("GIT_BRANCH") or os.getenv("CIRCLE_BRANCH") or os.getenv("BRANCH_NAME")
def _get_build_code(self):
return None
def _get_build_url(self):
return None
def _get_commit_sha(self):
return os.getenv("GIT_COMMIT")
def _get_slug(self):
return None
def _get_service(self):
return "local"
def _get_pull_request_number(self):
return None
def _get_job_code(self):
return None
def get_service_name(self):
return "Local"