mirror of
https://github.com/actions/labeler.git
synced 2025-12-13 21:17:02 +00:00
General refactoring
This commit is contained in:
16
src/api/get-content.ts
Normal file
16
src/api/get-content.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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();
|
||||
};
|
||||
Reference in New Issue
Block a user