Sha256: a431e301537dd465ca8e66cc93cb6ac1ce573f6d5462086a6c6c07a2ff5b62eb
Contents?: true
Size: 969 Bytes
Versions: 53
Compression:
Stored size: 969 Bytes
Contents
module KnapsackPro module Crypto class BranchEncryptor NON_ENCRYPTABLE_BRANCHES = [ 'master', 'main', 'develop', 'development', 'dev', 'staging', 'production', # GitHub Actions has branch names starting with refs/heads/ 'refs/heads/master', 'refs/heads/main', 'refs/heads/develop', 'refs/heads/development', 'refs/heads/dev', 'refs/heads/staging', 'refs/heads/production', ] def self.call(branch) if KnapsackPro::Config::Env.branch_encrypted? new(branch).call else branch end end def initialize(branch) @branch = branch end def call if NON_ENCRYPTABLE_BRANCHES.include?(branch) branch else Digestor.salt_hexdigest(branch)[0..6] end end private attr_reader :branch end end end
Version data entries
53 entries across 53 versions & 1 rubygems