Sha256: d59510dee8dbce9bfb23ff45941411420cc5d8fd7bc9b7e6c93daee4bbe4ac41

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'github_authentication'

begin
  require 'active_support'
  require 'active_support/cache'
  require 'active_support/notifications'
rescue LoadError
  warn("Active Support is required for the credential helper")
  exit(2)
end

case ARGV[0]
when 'get'
  exit_status = GithubAuthentication::GitCredentialHelper.new(
    pem: File.read(ENV.fetch('GITHUB_APP_KEYFILE')),
    app_id: ENV.fetch('GITHUB_APP_ID'),
    installation_id: ENV.fetch('GITHUB_APP_INSTALLATION_ID'),
    storage: ActiveSupport::Cache::FileStore.new(ENV.fetch('GITHUB_APP_CREDENTIAL_STORAGE_PATH'))
  ).handle_get
  exit(exit_status)
when 'store'
  # We maintain our own internal storage, so no-op any `store` requests
when nil, ''
  warn('Supported operations: get, store')
  exit(1)
else
  warn("Unknown argument: #{ARGV[0]}")
  exit(1)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github-authentication-1.0.2 exe/git-credential-github-app