File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import { Octokit } from "@octokit/core" ;
22import { Api } from "@octokit/plugin-rest-endpoint-methods/dist-types/types" ;
33import * as core from "@actions/core" ;
4- import { exit } from "process" ;
54
65export async function handleKBIssue (
76 octokit : Octokit & Api ,
@@ -22,8 +21,13 @@ export async function handleKBIssue(
2221
2322 if ( resp . status == 200 ) {
2423 let old_body = resp . data . body ;
25- let new_body = old_body + comment ;
24+ let action_name = get_action ( issue . title ) ;
25+ if ( old_body . indexOf ( action_name ) >= 0 ) {
26+ core . info ( `[!] Action ${ action_name } is already being tracked` ) ;
27+ return "Issue already being tracked" ;
28+ }
2629
30+ let new_body = old_body + comment ;
2731 let resp2 = await octokit . rest . issues . updateComment ( {
2832 owner : owner ,
2933 repo : repo ,
@@ -95,3 +99,8 @@ async function prepareComment(
9599 body : "unable to fetch analysis" ,
96100 } ) ;
97101}
102+
103+ function get_action ( x ) {
104+ x = x . split ( " " ) ;
105+ return x [ 6 ] ;
106+ }
You can’t perform that action at this time.
0 commit comments