class KnapsackPro::Config::CI::GithubActions

Public Instance Methods

branch() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 33
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
ci_provider() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 55
def ci_provider
  "GitHub Actions"
end
commit_hash() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 29
def commit_hash
  ENV['GITHUB_SHA']
end
detected() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 47
def detected
  ENV.key?('GITHUB_ACTIONS') ? self.class : nil
end
fixed_queue_split() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 51
def fixed_queue_split
  true
end
node_build_id() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 16
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_index() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 12
def node_index
  # not provided
end
node_retry_count() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 21
def node_retry_count
  # A unique number for each attempt of a particular workflow run in a repository.
  # This number begins at 1 for the workflow run's first attempt, and increments with each re-run.
  run_attempt = ENV['GITHUB_RUN_ATTEMPT']
  return unless run_attempt
  run_attempt.to_i - 1
end
node_total() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 8
def node_total
  # not provided
end
project_dir() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 39
def project_dir
  ENV['GITHUB_WORKSPACE']
end
user_seat() click to toggle source
# File lib/knapsack_pro/config/ci/github_actions.rb, line 43
def user_seat
  ENV['GITHUB_ACTOR']
end