Class: GithubActions::Tasks::Run

Inherits:
Object
  • Object
show all
Includes:
Colorizer
Defined in:
lib/tasks/github_actions/tasks/run.rb

Overview

run the requested Github Actions job locally

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Colorizer

#error, #info, #stage, #success, #warning

Constructor Details

#initialize(name) ⇒ Run

constructor

Parameters:

  • name (String)

    name of the job to run



34
35
36
# File 'lib/tasks/github_actions/tasks/run.rb', line 34

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

the requested job name



30
31
32
# File 'lib/tasks/github_actions/tasks/run.rb', line 30

def name
  @name
end

Instance Method Details

#runObject

run the GitHub Action locally



39
40
41
42
# File 'lib/tasks/github_actions/tasks/run.rb', line 39

def run
  runner = GithubActions::JobRunner.new(find_job, ENV["DOCKER_IMAGE"])
  abort unless runner.run
end