Class: Publisher::Providers::Info::Github
- Includes:
- Helpers, Singleton
- Defined in:
- lib/allure_report_publisher/lib/providers/info/github.rb
Overview
Github executor info
Constant Summary
Constants inherited from Base
Base::ALLURE_JOB_NAME, Base::ALLURE_RUN_ID
Instance Method Summary collapse
-
#build_name ⇒ String
Job name.
-
#build_url ⇒ String
Build url.
-
#executor(report_url) ⇒ Hash
Executor info.
-
#pr? ⇒ Boolean
Pull request run.
-
#repository ⇒ String
Github repository.
-
#run_id ⇒ String
Run id.
-
#server_url ⇒ String
Server url.
Methods included from Helpers
allure_cli?, colorize, debug_io, #env, error, execute_shell, log, log_debug, logger, pastel, path, reset_debug_io!
Instance Method Details
#build_name ⇒ String
Job name
50 51 52 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 50 def build_name @build_name ||= env(ALLURE_JOB_NAME) || env("GITHUB_JOB") end |
#build_url ⇒ String
Build url
64 65 66 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 64 def build_url @build_url ||= "#{server_url}/#{repository}/actions/runs/#{run_id}" end |
#executor(report_url) ⇒ Hash
Executor info
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 13 def executor(report_url) { name: "Github", type: "github", reportName: "AllureReport", reportUrl: report_url, url: server_url, buildUrl: build_url, buildOrder: run_id, buildName: build_name } end |
#pr? ⇒ Boolean
Pull request run
29 30 31 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 29 def pr? env("GITHUB_EVENT_NAME") == "pull_request" end |
#repository ⇒ String
Github repository
57 58 59 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 57 def repository @repository ||= env("GITHUB_REPOSITORY") end |
#run_id ⇒ String
Run id
36 37 38 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 36 def run_id @run_id ||= env(ALLURE_RUN_ID) || env("GITHUB_RUN_ID") end |
#server_url ⇒ String
Server url
43 44 45 |
# File 'lib/allure_report_publisher/lib/providers/info/github.rb', line 43 def server_url @server_url ||= env("GITHUB_SERVER_URL") end |