@@ -23,6 +23,17 @@ const getIssueComment = async (context, token, owner, repo, comment_id) => {
2323 return await sendGitHubAPIRequest ( context , token , 'GET' , `/repos/${ owner } /${ repo } /issues/comments/${ comment_id } ` )
2424}
2525
26+ const getGitArtifactsCommentID = async ( context , token , owner , repo , headSHA ) => {
27+ const answer = await sendGitHubAPIRequest ( context , token , 'GET' , `/search/issues?q=repo:${ owner } /${ repo } +${ headSHA } +type:pr+%22git-artifacts%22` , null , {
28+ Accept : 'application/vnd.github.text-match+json'
29+ } )
30+ const items = answer . items . filter ( item =>
31+ item . text_matches . length === 1
32+ && item . text_matches [ 0 ] . fragment === '/git-artifacts\n\nThe tag-git workflow run was started\n'
33+ )
34+ return items . length === 1 && items [ 0 ] . text_matches [ 0 ] . object_url . replace ( / ^ .* \/ ( \d + ) $ / , '$1' )
35+ }
36+
2637const appendToIssueComment = async ( context , token , owner , repo , comment_id , append ) => {
2738 const data = await getIssueComment ( context , token , owner , repo , comment_id )
2839 const answer = await sendGitHubAPIRequest (
@@ -65,6 +76,7 @@ const getPRCommitSHA = async (context, token, owner, repo, pullRequestNumber) =>
6576module . exports = {
6677 addIssueComment,
6778 getIssue,
79+ getGitArtifactsCommentID,
6880 getIssueComment,
6981 appendToIssueComment,
7082 createReactionForIssueComment,
0 commit comments