class GithubActions::Tasks::Details

print the defined Github Actions jobs with details

Public Instance Methods

run() click to toggle source
# File lib/tasks/github_actions/tasks/details.rb, line 29
def run
  Workflow.read.each_with_index do |workflow, index|
    workflow.jobs.each do |job|
      # empty line separator if multiple jobs are found
      puts if index > 0

      # print the job details
      success(job.name)
      puts "  run: \"rake actions:run[#{job.name}]\""
      puts "  container: #{job.container}"
      puts "  steps:"
      job.steps.each do |step|
        puts "    #{step.name}"
        puts "      #{step.run}" if step.run
        puts "      #{step.uses}" if step.uses
      end
    end
  end
end