Skip to content

Commit

Permalink
Merge pull request #255 from ham0215/master
Browse files Browse the repository at this point in the history
Improve workflowRun Slack notification title for clarity
  • Loading branch information
8398a7 authored Oct 10, 2024
2 parents 7d152f6 + f37bd55 commit 2ec70cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions __tests__/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const fixedFields = (fields: string, sha?: string) => {
ff.includes('eventName') ? eventName() : undefined,
ff.includes('ref') ? ref() : undefined,
ff.includes('workflow') ? workflow(sha) : undefined,
ff.includes('workflowRun') ? workflowRun() : undefined,
ff.includes('pullRequest') ? pullRequest() : undefined,
],
undefined,
Expand Down Expand Up @@ -151,6 +152,16 @@ export const workflow = (sha?: string): Field => {
};
};

export const workflowRun = (): Field => {
return {
short: true,
title: 'workflowRun',
value: `<https://github.com/8398a7/action-slack/actions/runs/762195612|${
process.env.GITHUB_WORKFLOW as string
}>`,
};
};

export const action = (sha?: string): Field => {
return {
short: true,
Expand Down
2 changes: 1 addition & 1 deletion src/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class FieldFactory {
? createAttachment('workflow', await this.workflow())
: undefined,
this.includes('workflowRun')
? createAttachment('workflow', await this.workflowRun())
? createAttachment('workflowRun', await this.workflowRun())
: undefined,
this.includes('pullRequest')
? createAttachment('pullRequest', await this.pullRequest())
Expand Down

0 comments on commit 2ec70cd

Please sign in to comment.