use GitHub context to branch processing (#22)

This commit is contained in:
Naoki Oketani
2019-12-13 12:18:28 +09:00
committed by GitHub
parent ac19a7500b
commit 3e659c8c99
14 changed files with 3579 additions and 80 deletions

19
src/pr.ts Normal file
View File

@@ -0,0 +1,19 @@
import axios, {AxiosResponse} from 'axios'
export async function createComment(
token: string,
owner: string,
repo: string,
prNumber: number,
body: string
): Promise<AxiosResponse> {
const instance = axios.create({
baseURL: 'https://api.github.com',
headers: {
Authorization: `token ${token}`
}
})
return instance.post(`/repos/${owner}/${repo}/issues/${prNumber}/comments`, {
body
})
}