Skip to content

Commit 082ff0e

Browse files
committed
fix(delete): Correct value for branch name (#18)
The message was showing the head branch instead of the branch deleted. Also removed the link (cause well umm) there's no branch anymore :D
1 parent 073d028 commit 082ff0e

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ All event messages will have these elements:
7575

7676
### Delete
7777

78-
![Delete](https://user-images.githubusercontent.com/5962998/104859330-f1661700-58fa-11eb-9e23-536d8ed443cd.png)
78+
![Delete](https://user-images.githubusercontent.com/5962998/104859938-0ba1f400-58ff-11eb-8645-9c5cedac4bde.png)
7979

80-
1. Branch Name - Also link to the branch.
80+
1. Branch Name
8181

8282
## Usage
8383

dist/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12860,10 +12860,8 @@ const getMessage = () => {
1286012860
return null;
1286112861
}
1286212862

12863-
const pre = 'refs/heads/';
12864-
const branchName = github.context.ref.substring(pre.length);
12865-
const branchUrl = `${github.context.payload.repository.html_url}/tree/${branchName}`;
12866-
return `Workflow <${runUrl}|${process.env.GITHUB_WORKFLOW}> for Deletion of Branch <${branchUrl}|${branchName}>`;
12863+
const branchName = github.context.payload.ref;
12864+
return `Workflow <${runUrl}|${process.env.GITHUB_WORKFLOW}> for Deletion of Branch \`${branchName}\``;
1286712865
}
1286812866

1286912867
default:

src/notify.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,8 @@ const getMessage = () => {
105105
return null;
106106
}
107107

108-
const pre = 'refs/heads/';
109-
const branchName = context.ref.substring(pre.length);
110-
const branchUrl = `${context.payload.repository.html_url}/tree/${branchName}`;
111-
112-
return `Workflow <${runUrl}|${process.env.GITHUB_WORKFLOW}> for Deletion of Branch <${branchUrl}|${branchName}>`;
108+
const branchName = context.payload.ref;
109+
return `Workflow <${runUrl}|${process.env.GITHUB_WORKFLOW}> for Deletion of Branch \`${branchName}\``;
113110
}
114111

115112
default:

0 commit comments

Comments
 (0)