Cast string 'base64' to the compatible Encoding type.

Signed-off-by: Kenneth Feng <kenneth.feng@onepeloton.com>
This commit is contained in:
Kenneth Feng
2021-10-25 10:16:44 -04:00
parent 7a5cb137b5
commit ce024e93ce
@@ -30,6 +30,8 @@ import { createPullRequest } from 'octokit-plugin-create-pull-request';
import globby from 'globby';
import { resolveSafeChildPath } from '@backstage/backend-common';
export type Encoding = 'utf-8' | 'base64';
class GithubResponseError extends CustomErrorBase {}
type CreatePullRequestResponse = {
@@ -210,8 +212,9 @@ export const createPublishGithubPullRequestAction = ({
//
// For example, the original gradle-wrapper.jar is 57.8k in https://github.com/kennethzfeng/pull-request-test/pull/5/files.
// Its size could be doubled to 98.3K (See https://github.com/kennethzfeng/pull-request-test/pull/4/files)
const encoding: Encoding = 'base64';
return {
encoding: 'base64',
encoding: encoding,
content: base64EncodedContent,
mode: githubTreeItemMode,
};