Skip to content

Commit

Permalink
Add workflowRun field
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Nov 19, 2022
1 parent d64b11c commit c3b7933
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export class FieldFactory {
this.includes('workflow')
? createAttachment('workflow', await this.workflow())
: undefined,
this.includes('workflowRun')
? createAttachment('workflow', await this.workflowRun())
: undefined,
this.includes('pullRequest')
? createAttachment('pullRequest', await this.pullRequest())
: undefined,
Expand Down Expand Up @@ -214,6 +217,13 @@ export class FieldFactory {
return value;
}

private async workflowRun(): Promise<string> {
const { owner, repo } = context.repo;
const value = `<${this.gitHubBaseUrl}/${owner}/${repo}/actions/runs/${context.runId}|${context.workflow}>`;
process.env.AS_WORKFLOW_RUN = value;
return value;
}

private async pullRequest(): Promise<string> {
let value;
if (context.eventName.startsWith('pull_request')) {
Expand Down

0 comments on commit c3b7933

Please sign in to comment.