File tree Expand file tree Collapse file tree 5 files changed +17
-1
lines changed Expand file tree Collapse file tree 5 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 4
4
dev-env-vars
5
5
.coverage *
6
6
__pycache__
7
+ .idea /
Original file line number Diff line number Diff line change @@ -313,6 +313,9 @@ jobs:
313
313
with :
314
314
GITHUB_TOKEN : ${{ github.token }}
315
315
316
+ # Change this in case you use GitHub Entreprise with a different API endpoint
317
+ GITHUB_BASE_URL : https://api.github.com
318
+
316
319
# Only necessary in the "workflow_run" workflow.
317
320
GITHUB_PR_RUN_ID : ${{ inputs.GITHUB_PR_RUN_ID }}
318
321
@@ -594,6 +597,10 @@ source =
594
597
This action is supposedly compatible with private repository. Just make sure
595
598
to use the svg badge directly, and not the `shields.io` URL.
596
599
600
+ # # Github Enterprise (GHE) Support
601
+
602
+ This action should be compatible with GitHub Enterprise. Just make sure to set the `GITHUB_BASE_URL` input to your GHE URL.
603
+
597
604
# # Upgrading from v2 to v3
598
605
599
606
When upgrading, we change the location and format where the coverage
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ description: >
6
6
Publish diff coverage report as PR comment, and create a coverage badge
7
7
to display on the readme.
8
8
inputs :
9
+ GITHUB_BASE_URL :
10
+ description : >
11
+ The base URL for the GitHub API, typically used to specify custom endpoints
12
+ for GitHub Enterprise Server (e.g., `https://github.mycompany.com/api/v3`).
13
+ Defaults to `https://api.github.com` for GitHub.com.
14
+ default : " https://api.github.com"
15
+ required : false
9
16
GITHUB_TOKEN :
10
17
description : >
11
18
A GitHub token to write comments and write the badge & coverage data
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def main():
34
34
config = settings .Config .from_environ (environ = os .environ )
35
35
36
36
github_session = httpx .Client (
37
- base_url = "https://api.github.com" ,
37
+ base_url = config . GITHUB_BASE_URL ,
38
38
follow_redirects = True ,
39
39
headers = {"Authorization" : f"token { config .GITHUB_TOKEN } " },
40
40
)
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class Config:
37
37
38
38
# A branch name, not a fully-formed ref. For example, `main`.
39
39
GITHUB_BASE_REF : str
40
+ GITHUB_BASE_URL : str = "https://api.github.com"
40
41
GITHUB_TOKEN : str = dataclasses .field (repr = False )
41
42
GITHUB_REPOSITORY : str
42
43
# > The ref given is fully-formed, meaning that for branches the format is
You can’t perform that action at this time.
0 commit comments