diff --git a/README.md b/README.md index 02d67a6..1d65fbd 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,5 @@ -![logo](docs/assets/logo.png) - -[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test] -[![actions-marketplace][actions-marketplace-badge]][actions-marketplace] -[![release][release-badge]][release] -[![pkg.go.dev][pkg.go.dev-badge]][pkg.go.dev] -[![dependabot][dependabot-badge]][dependabot] -[![license][license-badge]][license] +## Heads up +⚠️ ‼️ I'm archiving this fork, as GHES and GHAE customers should use https://github.com/github/safe-settings#the-settings-file for this instead GitHub Actions workflow to sync GitHub labels in the declarative way. diff --git a/cmd/action-label-syncer/main.go b/cmd/action-label-syncer/main.go index a871228..f811dca 100644 --- a/cmd/action-label-syncer/main.go +++ b/cmd/action-label-syncer/main.go @@ -48,7 +48,10 @@ func run(ctx context.Context) error { if len(token) == 0 { token = os.Getenv("GITHUB_TOKEN") } - client := github.NewClient(token) + + rawurl := os.Getenv("GITHUB_API_URL") + + client := github.NewClient(token, rawurl) repository := os.Getenv("INPUT_REPOSITORY") if len(repository) == 0 { diff --git a/pkg/github/github.go b/pkg/github/github.go index 361a450..470251c 100644 --- a/pkg/github/github.go +++ b/pkg/github/github.go @@ -46,14 +46,18 @@ func FromManifestToLabels(path string) ([]Label, error) { return labels, err } -func NewClient(token string) *Client { +func NewClient(token string, rawurl string) *Client { ctx := context.Background() ts := oauth2.StaticTokenSource( &oauth2.Token{AccessToken: token}, ) tc := oauth2.NewClient(ctx, ts) + githubClient, err := github.NewEnterpriseClient(rawurl, rawurl, tc) + if err != nil { + panic(err) + } return &Client{ - githubClient: github.NewClient(tc), + githubClient: githubClient, } }