diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index c2a5378..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: coverage -on: [push] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Ruby (3.4) - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.4 - - uses: amancevice/setup-code-climate@v0 - with: - cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }} - - run: cc-test-reporter before-build - - name: Build and test with RSpec - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec rspec - - run: cc-test-reporter after-build diff --git a/.github/workflows/danger-comment.yml b/.github/workflows/danger-comment.yml new file mode 100644 index 0000000..8e15cb6 --- /dev/null +++ b/.github/workflows/danger-comment.yml @@ -0,0 +1,11 @@ +name: Danger Comment + +on: + workflow_run: + workflows: [Danger] + types: [completed] + +jobs: + comment: + uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0 + secrets: inherit diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 8109d16..a7a9e5c 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,22 +1,12 @@ --- -name: danger +name: Danger on: pull_request: types: [opened, reopened, edited, synchronize] jobs: danger: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - name: Run Danger - run: | - # the personal token is public, this is ok, base64 encode to avoid tripping Github - TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) - DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose + uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0 + secrets: inherit + with: + ruby-version: "3.1" + danger-args: "dry_run --base=origin/main" diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e7f46b..ea4bb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### 0.3.1 (Next) +* [#14](https://github.com/dblock/ruby-link-checker/pull/14): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/Copilot). +* [#14](https://github.com/dblock/ruby-link-checker/pull/14): Removed Code Climate - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/Copilot). * Your contribution here. ### 0.3.0 (2025-07-05) diff --git a/Dangerfile b/Dangerfile index a0a4a57..b4bc366 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,4 +1,6 @@ # frozen_string_literal: true +danger.import_dangerfile(gem: 'danger-pr-comment') + changelog.check! toc.check! diff --git a/Gemfile b/Gemfile index c8732ec..ee2e76c 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ gem 'rake' group :development, :test do gem 'danger' gem 'danger-changelog', '0.6.1' + gem 'danger-pr-comment' gem 'danger-toc', '0.2.0' gem 'rspec', '~> 3.0' gem 'rubocop', '~> 1.0' diff --git a/README.md b/README.md index 6da5274..cf52fda 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ Fast Ruby Link Checker [![Gem Version](http://img.shields.io/gem/v/ruby-link-checker.svg)](http://badge.fury.io/rb/ruby-link-checker) [![Build Status](https://github.com/dblock/ruby-link-checker/workflows/test/badge.svg?branch=main)](https://github.com/dblock/ruby-link-checker/actions) -[![Code Climate](https://codeclimate.com/github/dblock/ruby-link-checker.svg)](https://codeclimate.com/github/dblock/ruby-link-checker) -[![Test Coverage](https://api.codeclimate.com/v1/badges/164f1e23fc706b6efa63/test_coverage)](https://codeclimate.com/github/dblock/ruby-link-checker/test_coverage) A fast Ruby link checker with support for multiple HTTP libraries. Does not parse documents, just checks links. Fast. Anecdotal benchmarking on a M1 mac and T1 Internet yields ~50 URLs per second with `LinkChecker::Typhoeus::Hydra`. diff --git a/lib/ruby-link-checker/net/http/checker.rb b/lib/ruby-link-checker/net/http/checker.rb index 559e623..ad35b6d 100644 --- a/lib/ruby-link-checker/net/http/checker.rb +++ b/lib/ruby-link-checker/net/http/checker.rb @@ -16,6 +16,7 @@ def run! class Checker < LinkChecker::Checker extend ::LinkChecker::Net::HTTP::Config + attr_accessor(*LinkChecker::Net::HTTP::Config::ATTRIBUTES) def initialize(options = {}) diff --git a/lib/ruby-link-checker/typhoeus/hydra/checker.rb b/lib/ruby-link-checker/typhoeus/hydra/checker.rb index 0c0f269..7d47dac 100644 --- a/lib/ruby-link-checker/typhoeus/hydra/checker.rb +++ b/lib/ruby-link-checker/typhoeus/hydra/checker.rb @@ -27,6 +27,7 @@ def run! class Checker < LinkChecker::Checker extend ::LinkChecker::Typhoeus::Hydra::Config + attr_accessor(*LinkChecker::Typhoeus::Hydra::Config::ATTRIBUTES) def initialize(options = {})