Support Github Enterprise

This commit is contained in:
chitran96
2023-06-15 18:05:49 +07:00
parent 7c43950175
commit a92044f974
2 changed files with 7 additions and 1 deletions

View File

@@ -6,6 +6,11 @@ description: >
Publish diff coverage report as PR comment, and create a coverage badge Publish diff coverage report as PR comment, and create a coverage badge
to display on the readme. to display on the readme.
inputs: inputs:
GITHUB_URL:
description: >
A Github base url, api.github.com by default but can be different in GitHub Enterprise
default: "https://api.github.com"
required: false
GITHUB_TOKEN: GITHUB_TOKEN:
description: > description: >
A GitHub token to write comments and write the badge to the wiki A GitHub token to write comments and write the badge to the wiki

View File

@@ -56,6 +56,7 @@ class Config:
GITHUB_BASE_REF: str GITHUB_BASE_REF: str
GITHUB_TOKEN: str GITHUB_TOKEN: str
GITHUB_BASE_URL: str
GITHUB_REPOSITORY: str GITHUB_REPOSITORY: str
GITHUB_REF: str GITHUB_REF: str
BADGE_FILENAME: str = "coverage-comment-badge.json" BADGE_FILENAME: str = "coverage-comment-badge.json"
@@ -117,7 +118,7 @@ class Config:
def get_api(config: Config) -> github.Github: def get_api(config: Config) -> github.Github:
return github.Github(config.GITHUB_TOKEN) return github.Github(config.GITHUB_TOKEN, config.GITHUB_BASE_URL)
def get_coverage_info(config: Config) -> dict: def get_coverage_info(config: Config) -> dict: