2022-09-13 21:54:30 -04:00
|
|
|
const { danger, markdown, fail, warn, message } = require('danger')
|
|
|
|
const awesomeBotResults = require('./ab-results-README.md-markdown-table.json')
|
|
|
|
|
2022-09-13 22:35:32 -04:00
|
|
|
const githubMetadata = danger.git.fileMatch('.github/**')
|
2022-09-13 21:54:30 -04:00
|
|
|
const yamlData = danger.git.fileMatch('data/**')
|
2022-09-13 22:35:32 -04:00
|
|
|
const scripts = danger.git.fileMatch('scripts/**')
|
|
|
|
const src = danger.git.fileMatch('src/**')
|
2022-09-13 21:54:30 -04:00
|
|
|
|
2022-09-13 22:35:32 -04:00
|
|
|
if (githubMetadata.edited) {
|
|
|
|
message('Changes were made within the .github folder.')
|
2022-09-13 21:54:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (yamlData.edited) {
|
2022-09-13 22:35:32 -04:00
|
|
|
message('YAML data files were edited.')
|
|
|
|
/**
|
|
|
|
* Only display awesomeBot results if the data yaml used to generate the readme have been modified.
|
|
|
|
*/
|
2022-09-14 15:08:48 -04:00
|
|
|
if (awesomeBotResults.error) {
|
|
|
|
fail(awesomeBotResults.title)
|
|
|
|
markdown(awesomeBotResults.message)
|
|
|
|
}
|
2022-09-13 21:54:30 -04:00
|
|
|
}
|
|
|
|
|
2022-09-13 22:35:32 -04:00
|
|
|
if (scripts.edited) {
|
|
|
|
warn('Changes were made to the scripts folder.')
|
2022-09-13 21:54:30 -04:00
|
|
|
}
|
|
|
|
|
2022-09-13 22:35:32 -04:00
|
|
|
if (src.edited) {
|
|
|
|
warn('Changes were made to the src folder.')
|
2022-09-13 21:54:30 -04:00
|
|
|
}
|