mirror of
https://github.com/ipfs/awesome-ipfs.git
synced 2024-11-20 11:28:35 -05:00
chore: modify dangerfile and workflow ordering
This commit is contained in:
parent
edf42873af
commit
ad73266f50
2 changed files with 20 additions and 20 deletions
3
.github/workflows/pull_requests.yml
vendored
3
.github/workflows/pull_requests.yml
vendored
|
@ -37,10 +37,13 @@ jobs:
|
|||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-danger:
|
||||
runs-on: ubuntu-latest
|
||||
needs: update-readme
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
|
|
|
@ -1,33 +1,30 @@
|
|||
const { danger, markdown, fail, warn, message } = require('danger')
|
||||
const awesomeBotResults = require('./ab-results-README.md-markdown-table.json')
|
||||
|
||||
// declare const danger: DangerDSLType
|
||||
// declare function warn(message: string, file?: string, line?: number): void
|
||||
// declare function fail(params: string): void
|
||||
// declare function message(message: string): void
|
||||
|
||||
// This is a simple example of a Dangerfile.
|
||||
// You can run this Dangerfile via `danger pr
|
||||
|
||||
const docs = danger.git.fileMatch('**/*.md')
|
||||
const app = danger.git.fileMatch('src/**/*.ts')
|
||||
const tests = danger.git.fileMatch('*/__tests__/*')
|
||||
const githubMetadata = danger.git.fileMatch('.github/**')
|
||||
const yamlData = danger.git.fileMatch('data/**')
|
||||
// const awesome_bot = danger.git.fileMatch('ab-results-README.md-markdown-table.json')
|
||||
const scripts = danger.git.fileMatch('scripts/**')
|
||||
const src = danger.git.fileMatch('src/**')
|
||||
|
||||
if (githubMetadata.edited) {
|
||||
message('Changes were made within the .github folder.')
|
||||
}
|
||||
|
||||
if (yamlData.edited) {
|
||||
message('YAML data files were edited.')
|
||||
/**
|
||||
* Only display awesomeBot results if the data yaml used to generate the readme have been modified.
|
||||
*/
|
||||
if (awesomeBotResults.error) {
|
||||
fail(awesomeBotResults.title)
|
||||
markdown(awesomeBotResults.message)
|
||||
}
|
||||
|
||||
if (yamlData.edited) {
|
||||
message('YAML data files were edited')
|
||||
}
|
||||
|
||||
if (docs.edited) {
|
||||
message('Thanks - We :heart: our [documentarians](http://www.writethedocs.org/)!')
|
||||
if (scripts.edited) {
|
||||
warn('Changes were made to the scripts folder.')
|
||||
}
|
||||
|
||||
if (app.modified && !tests.modified) {
|
||||
warn('You have app changes without tests.')
|
||||
if (src.edited) {
|
||||
warn('Changes were made to the src folder.')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue