Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/validate-pr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,18 @@ async function run() {
}
changedApis.sort((a, b) => a.api.localeCompare(b.api))

let comment = `Following you can find the validation changes against the target branch for the API${changedApis.length === 1 ? '' : 's'}.\n\n`
if (changedApis.length > 0) {
let comment = `Following you can find the validation changes for the API${changedApis.length === 1 ? '' : 's'} you have modified.\n\n`
comment += '| API | Status | Request | Response |\n'
comment += '| --- | --- | --- | --- |\n'
for (const change of changedApis) {
comment += buildDiffTableLine(change)
}
comment += `\nYou can validate ${changedApis.length === 1 ? 'this' : 'these'} API${changedApis.length === 1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`

core.setOutput('has_results', 'true')
core.setOutput('comment_body', comment)
} else {
core.setOutput('has_results', 'false')
comment += '**No changes detected**.\n'
}
comment += `\nYou can validate ${changedApis.length === 1 ? 'this' : 'these'} API${changedApis.length === 1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`
core.setOutput('comment_body', comment)

core.info('Done!')
}
Expand Down Expand Up @@ -231,4 +229,4 @@ function generateResponse (r) {
run().catch((err) => {
core.error(err)
process.exit(1)
})
})
1 change: 0 additions & 1 deletion .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ jobs:
body-includes: 'Following you can find the validation changes'

- name: Create or update comment
if: steps.validation.outputs.has_results == 'true'
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down