You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output validation comments even without changes (#4781) (#4799)
* Output validation comments even without changes
Otherwise, a PR that breaks validation but then restores it will keep a comment
saying that validation is broken.
* Adjust output
* Try fixing branch name
* Stop trying to display the target branch
(cherry picked from commit bbd5dcf)
Co-authored-by: Quentin Pradet <[email protected]>
letcomment=`Following you can find the validation changes against the target branch for the API${changedApis.length===1 ? '' : 's'}.\n\n`
152
153
if(changedApis.length>0){
153
-
letcomment=`Following you can find the validation changes for the API${changedApis.length===1 ? '' : 's'} you have modified.\n\n`
154
154
comment+='| API | Status | Request | Response |\n'
155
155
comment+='| --- | --- | --- | --- |\n'
156
156
for(constchangeofchangedApis){
157
157
comment+=buildDiffTableLine(change)
158
158
}
159
-
comment+=`\nYou can validate ${changedApis.length===1 ? 'this' : 'these'} API${changedApis.length===1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`
160
-
161
-
core.setOutput('has_results','true')
162
-
core.setOutput('comment_body',comment)
163
159
}else{
164
-
core.setOutput('has_results','false')
160
+
comment+='**No changes detected**.\n'
165
161
}
162
+
comment+=`\nYou can validate ${changedApis.length===1 ? 'this' : 'these'} API${changedApis.length===1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`
163
+
core.setOutput('comment_body',comment)
166
164
167
165
core.info('Done!')
168
166
}
@@ -236,4 +234,4 @@ function generateResponse (r) {
0 commit comments