mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 04:27:34 +00:00
17 lines
452 B
TypeScript
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();
|
|
};
|