diff --git a/README.md b/README.md index 2989a33..f97557b 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ jobs: - name: Checkout uses: actions/checkout@v1 - name: Open PR for new release of Krew Plugin - uses: rajatjindal/krew-plugin-release@v0.0.27 + uses: rajatjindal/krew-plugin-release@v0.0.28 with: plugin-name: 'your-plugin-name' upstream-krew-index-owner: 'kubernetes-sigs' diff --git a/action.yml b/action.yml index 87718bf..2db1ae8 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,7 @@ inputs: required: false runs: using: 'docker' - image: 'docker://rajatjindal/krew-plugin-release:v0.0.27' + image: 'docker://rajatjindal/krew-plugin-release:v0.0.28' args: - ${{ inputs.upstream-krew-index-owner }} - ${{ inputs.upstream-krew-index-repo-name }} diff --git a/pkg/actions/actions.go b/pkg/actions/actions.go index 97883d9..683d6f8 100644 --- a/pkg/actions/actions.go +++ b/pkg/actions/actions.go @@ -65,7 +65,7 @@ func (r RealAction) GetActionData() (ActionData, error) { } token := os.Getenv("KREW_PLUGIN_RELEASE_TOKEN") - tokenUserEmail, tokenUserName, err := r.getUserInfo(tokenUserHandle, token) + tokenUserEmail, tokenUserName, err := r.getUserInfo(token) if err != nil { return ActionData{}, err } @@ -122,12 +122,12 @@ func (r RealAction) getPayload() ([]byte, error) { return data, nil } -func (r RealAction) getUserInfo(username, token string) (string, string, error) { +func (r RealAction) getUserInfo(token string) (string, string, error) { ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) tc := oauth2.NewClient(context.TODO(), ts) client := github.NewClient(tc) - user, _, err := client.Users.Get(context.TODO(), username) + user, _, err := client.Users.Get(context.TODO(), "") if err != nil { return "", "", err }