Files
labeler/src/api/get-content.ts
Nikolai Laevskii 3b7f505149 General refactoring
2023-08-02 06:13:14 +02:00

17 lines
452 B
TypeScript

import * as github from '@actions/github';
import {ClientType} from './types';
export const getContent = async (
client: ClientType,
repoPath: string
): Promise<string> => {
const response: any = await client.rest.repos.getContent({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
path: repoPath,
ref: github.context.sha
});
return Buffer.from(response.data.content, response.data.encoding).toString();
};