/
zhendosina
/
github-translate-action
Обзор
Документация
Войти
/
zhendosina
/
github-translate-action
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modes/pull_request.ts
44 строки
1 KB
lizheming
chore: fix bug
14 май 2023, 06:27
14 май 2023, 06:27
43a85ad
Код
Авторство
О чём код?
import * as core from '@actions/core' import * as github from '@actions/github' export default { get match() { const { context: { payload: { pull_request } } } = github return Boolean(pull_request?.number) }, get title() { return github.context.payload.pull_request?.title }, get body() { return github.context.payload.pull_request?.body }, async update(octokit: ReturnType<typeof github.getOctokit>, body?: string | null, title?: string | null): Promise<void> { const { context: { repo: { owner, repo }, payload: { pull_request } } } = github if (!pull_request?.number) { return } await octokit.pulls.update({ owner, repo, pull_number: pull_request?.number, title: title && title !== 'null' ? title : undefined, body: body && body !== 'null' ? body : undefined, }) const url = github.context.payload.pull_request?.html_url if (title) { core.info(`complete to modify translate pull_request title: ${title} in ${url} `) } if (body) { core.info(`complete to modify translate pull_request body: ${body} in ${url} `) } } }