This commit is contained in:
839 2020-06-12 23:33:27 +09:00
Родитель 631738ba93
Коммит 39f698bdfb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B320DBCCE13B7629
1 изменённых файлов: 22 добавлений и 17 удалений

Просмотреть файл

@ -140,16 +140,6 @@ export class Client {
});
const author = commit?.data.commit.author;
const runId = process.env.GITHUB_RUN_ID as string;
const resp = await this.github?.actions.listJobsForWorkflowRun({
owner,
repo,
run_id: parseInt(runId, 10),
});
const jobId = resp?.data.jobs.find(
job => job.name === process.env.GITHUB_JOB,
)?.id;
return this.filterField(
[
this.repo,
@ -170,13 +160,7 @@ export class Client {
short: true,
}
: undefined,
jobId && this.includesField('job')
? {
title: 'job',
value: `<https://github.com/${owner}/${repo}/runs/${jobId}|${process.env.GITHUB_JOB}>`,
short: true,
}
: undefined,
await this.job(),
this.action,
this.eventName,
this.ref,
@ -186,6 +170,27 @@ export class Client {
);
}
private async job(): Promise<Field | undefined> {
if (!this.includesField('job')) return undefined;
const { owner, repo } = github.context.repo;
const runId = process.env.GITHUB_RUN_ID as string;
const resp = await this.github?.actions.listJobsForWorkflowRun({
owner,
repo,
run_id: parseInt(runId, 10),
});
const jobId = resp?.data.jobs.find(
job => job.name === process.env.GITHUB_JOB,
)?.id;
return {
title: 'job',
value: `<https://github.com/${owner}/${repo}/runs/${jobId}|${process.env.GITHUB_JOB}>`,
short: true,
};
}
private get commit(): Field | undefined {
if (!this.includesField('commit')) return undefined;