diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 000000000..6b0df107a --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,22 @@ +name: Danger +on: + - pull_request +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true +jobs: + danger: + name: Danger + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: "3.2" + - name: Run Danger + run: bundle exec danger + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 000000000..1e2572354 --- /dev/null +++ b/Dangerfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +diff = git.diff_for_file('config/default.yml') +if diff && diff.patch =~ /^\+\s*Enabled: true$/ + warn(<<~MESSAGE) + There is a cop that became `Enabled: true` due to this pull request. + Please review the diff and make sure there are no issues. + MESSAGE +end diff --git a/Gemfile b/Gemfile index f6fddf529..04687217d 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ source 'https://rubygems.org' gemspec gem 'bump' +gem 'danger' gem 'rack' gem 'rake' gem 'rspec', '~> 3.11'