Skip to content

Commit

Permalink
fix dummy server
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Sep 20, 2021
1 parent 295f45a commit fc71890
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function assumeRole(params: GetTokenParams) {
const result = await client.postJson<GetTokenResult | GetTokenError>(params.providerEndpoint, payload, headers);
if (result.statusCode !== http.HttpCodes.OK) {
const resp = result.result as GetTokenError;
core.setFailed(resp.message);
core.setFailed(resp?.message || "unknown error");
return;
}
const resp = result.result as GetTokenResult;
Expand Down
3 changes: 2 additions & 1 deletion provider/github-app-token/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package githubapptoken

import (
"context"
"errors"
"net/http"

"github.com/shogo82148/actions-github-app-token/provider/github-app-token/github"
Expand Down Expand Up @@ -45,7 +46,7 @@ func (c *githubClientDummy) ValidateAPIURL(url string) error {
}

func (c *githubClientDummy) ParseIDToken(ctx context.Context, idToken string) (*github.ActionsIDToken, error) {
return &github.ActionsIDToken{}, nil
return nil, errors.New("invalid jwt")
}

func NewDummyHandler() *Handler {
Expand Down

0 comments on commit fc71890

Please sign in to comment.