mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-12 12:36:55 +00:00
Update authorization for PAT to be Bearer as documented (#3039)
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"encoding/base64"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -835,8 +834,7 @@ func (c *Client) getRunnerRegistrationToken(ctx context.Context) (*registrationT
|
|||||||
bearerToken := ""
|
bearerToken := ""
|
||||||
|
|
||||||
if c.creds.Token != "" {
|
if c.creds.Token != "" {
|
||||||
encodedToken := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("github:%v", c.creds.Token)))
|
bearerToken = fmt.Sprintf("Bearer %v", c.creds.Token)
|
||||||
bearerToken = fmt.Sprintf("Basic %v", encodedToken)
|
|
||||||
} else {
|
} else {
|
||||||
accessToken, err := c.fetchAccessToken(ctx, c.config.ConfigURL.String(), c.creds.AppCreds)
|
accessToken, err := c.fetchAccessToken(ctx, c.config.ConfigURL.String(), c.creds.AppCreds)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user