Class: GithubService

Inherits:
Object
  • Object
show all
Defined in:
lib/uffizzi/services/github_service.rb

Constant Summary collapse

GITHUB_OUTPUT =
'GITHUB_OUTPUT'

Class Method Summary collapse

Class Method Details

.github_actions_exists?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/uffizzi/services/github_service.rb', line 17

def github_actions_exists?
  ENV['GITHUB_ACTIONS'].present?
end

.write_to_github_env(data) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/uffizzi/services/github_service.rb', line 7

def write_to_github_env(data)
  return unless data.is_a?(Hash)

  github_output = ENV.fetch(GITHUB_OUTPUT) { raise "#{GITHUB_OUTPUT} is not defined" }

  File.open(github_output, 'a') do |f|
    data.each { |(key, value)| f.puts("#{key}=#{value}") }
  end
end