@@ -9900,12 +9900,12 @@ function wrappy (fn, cb) {
99009900/***/ 4570 :
99019901/***/ ( ( module ) => {
99029902
9903- const commentTitle = "Barecheck - Code coverage report" ;
9903+ const githubCommentTitle = "Code coverage report" ;
99049904
99059905const barecheckApiUrl = "https://api.barecheck.com/graphql" ;
99069906
99079907module . exports = {
9908- commentTitle ,
9908+ githubCommentTitle ,
99099909 barecheckApiUrl
99109910} ;
99119911
@@ -9964,7 +9964,7 @@ const getChangedFiles = __nccwpck_require__(397);
99649964const createOrUpdateComment = __nccwpck_require__ ( 8646 ) ;
99659965const buildBody = __nccwpck_require__ ( 681 ) ;
99669966
9967- const { commentTitle } = __nccwpck_require__ ( 4570 ) ;
9967+ const { buildGithubCommentTitle } = __nccwpck_require__ ( 1006 ) ;
99689968
99699969const sendSummaryComment = async (
99709970 coverageDiff ,
@@ -9984,9 +9984,9 @@ const sendSummaryComment = async (
99849984 totalCoverage ,
99859985 compareFileData
99869986 ) ;
9987-
9987+ const githubCommentTitle = buildGithubCommentTitle ( ) ;
99889988 // we can add an option how comments should be added create | update | none
9989- await createOrUpdateComment ( commentTitle , body ) ;
9989+ await createOrUpdateComment ( githubCommentTitle , body ) ;
99909990 }
99919991} ;
99929992
@@ -10052,7 +10052,7 @@ module.exports = {
1005210052/***/ 681 :
1005310053/***/ ( ( module , __unused_webpack_exports , __nccwpck_require__ ) => {
1005410054
10055- const { commentTitle } = __nccwpck_require__ ( 4570 ) ;
10055+ const { buildGithubCommentTitle } = __nccwpck_require__ ( 1006 ) ;
1005610056const { uncoveredFileLinesByFileNames } = __nccwpck_require__ ( 3318 ) ;
1005710057const { mergeFileLinesWithChangedFiles } = __nccwpck_require__ ( 3257 ) ;
1005810058
@@ -10065,7 +10065,7 @@ const buildFullMessage = (
1006510065) => {
1006610066 const coverageDiffOutput = coverageDiff < 0 ? "▾" : "▴" ;
1006710067 const trendArrow = coverageDiff === 0 ? "" : coverageDiffOutput ;
10068- const header = commentTitle ;
10068+ const header = buildGithubCommentTitle ( ) ;
1006910069 const descTotal = `Total: <b>${ totalCoverage } %</b>` ;
1007010070 const descCoverageDiff = `Your code coverage diff: <b>${ coverageDiff } % ${ trendArrow } </b>` ;
1007110071 const description = `${ descTotal } \n\n${ descCoverageDiff } ` ;
@@ -10328,6 +10328,25 @@ const updateComment = async (commentId, body) => {
1032810328module . exports = updateComment ;
1032910329
1033010330
10331+ /***/ } ) ,
10332+
10333+ /***/ 1006 :
10334+ /***/ ( ( module , __unused_webpack_exports , __nccwpck_require__ ) => {
10335+
10336+ const { getAppName } = __nccwpck_require__ ( 6 ) ;
10337+ const { githubCommentTitle } = __nccwpck_require__ ( 4570 ) ;
10338+
10339+ const buildGithubCommentTitle = ( ) => {
10340+ const appName = getAppName ( ) ;
10341+
10342+ return `${ appName !== "" ? appName : "Barecheck" } - ${ githubCommentTitle } ` ;
10343+ } ;
10344+
10345+ module . exports = {
10346+ buildGithubCommentTitle
10347+ } ;
10348+
10349+
1033110350/***/ } ) ,
1033210351
1033310352/***/ 6 :
@@ -10355,13 +10374,16 @@ const getShowAnnotations = () => {
1035510374
1035610375const getGithubToken = ( ) => core . getInput ( "github-token" ) ;
1035710376
10377+ const getAppName = ( ) => core . getInput ( "app-name" ) ;
10378+
1035810379const getBarecheckGithubAppToken = ( ) =>
1035910380 core . getInput ( "barecheck-github-app-token" ) ;
1036010381
1036110382module . exports = {
1036210383 getShowAnnotations,
1036310384 getGithubToken,
10364- getBarecheckGithubAppToken
10385+ getBarecheckGithubAppToken,
10386+ getAppName
1036510387} ;
1036610388
1036710389
@@ -10512,15 +10534,15 @@ const createGithubAccessToken = async (githubAppToken) => {
1051210534 githubAppToken
1051310535 } ;
1051410536
10515- const { data } = await makeRequest ( query , variables ) ;
10537+ const response = await makeRequest ( query , variables ) ;
1051610538
10517- if ( ! data . createGithubAccessToken . success ) {
10539+ if ( ! response . data && ! response . data . createGithubAccessToken . success ) {
1051810540 throw new Error (
1051910541 "Couldn't fetch access token for Github application. Check if you use the correct `BARECHECK_GITHUB_APP_TOKEN`"
1052010542 ) ;
1052110543 }
1052210544
10523- return data . createGithubAccessToken ;
10545+ return response . data . createGithubAccessToken ;
1052410546} ;
1052510547
1052610548module . exports = {
0 commit comments