github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/source/github/manganese.go (about)

     1  package github
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/projecteru2/core/source/common"
     7  	"github.com/projecteru2/core/types"
     8  )
     9  
    10  // New new a github obj
    11  func New(config types.Config) (*common.GitScm, error) {
    12  	gitConfig := config.Git
    13  	token := fmt.Sprintf("token %s", gitConfig.Token)
    14  	authHeaders := map[string]string{"Authorization": token}
    15  	return common.NewGitScm(gitConfig, authHeaders)
    16  }