diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 00000000..d833c364 --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,21 @@ +name: Danger +on: + workflow_dispatch: + pull_request: + types: [synchronize, edited, opened, reopened] +jobs: + run: + name: Run danger checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 100 + submodules: 'recursive' + - name: Install danger + run: | + sudo gem install danger + - name: Run danger + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: danger diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 00000000..5e637670 --- /dev/null +++ b/Dangerfile @@ -0,0 +1,12 @@ +def changelog_was_not_updated? + !git.modified_files.include? "CHANGELOG.md" +end + +def complicated? + !github.pr_body.include? "#trivial" +end + +if changelog_was_not_updated? && complicated? + fail "You need to update the changelog. Your pull request will not be merged until this is done." + markdown "ProTip: Even if you think something is super simple, it should be in the changelog. Literally the only exception to this rule is if your commit isn't touching code." +end