Class: KnapsackPro::Config::CI::GithubActions

Inherits:
Base
  • Object
show all
Defined in:
lib/knapsack_pro/config/ci/github_actions.rb

Instance Method Summary collapse

Methods inherited from Base

#node_retry_count

Instance Method Details

#branchObject



23
24
25
26
27
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 23

def branch
  # GITHUB_REF - The branch or tag ref that triggered the workflow. For example, refs/heads/feature-branch-1.
  # If neither a branch or tag is available for the event type, the variable will not exist.
  ENV['GITHUB_REF'] || ENV['GITHUB_SHA']
end

#commit_hashObject



19
20
21
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 19

def commit_hash
  ENV['GITHUB_SHA']
end

#node_build_idObject



14
15
16
17
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 14

def node_build_id
  # A unique number for each run within a repository. This number does not change if you re-run the workflow run.
  ENV['GITHUB_RUN_ID']
end

#node_indexObject



10
11
12
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 10

def node_index
  # not provided
end

#node_totalObject



6
7
8
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 6

def node_total
  # not provided
end

#project_dirObject



29
30
31
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 29

def project_dir
  ENV['GITHUB_WORKSPACE']
end

#user_seatObject



33
34
35
# File 'lib/knapsack_pro/config/ci/github_actions.rb', line 33

def user_seat
  ENV['GITHUB_ACTOR']
end