From 6580f6ec2218e0a2cf0dfaf85c9bbca4f48ab167 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Fri, 21 Aug 2026 12:56:46 -0500 Subject: [PATCH] Migrate Danger to use danger-pr-comment workflow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/danger-comment.yml | 16 ++++++++++++++++ .github/workflows/danger.yml | 26 +++++++++----------------- CHANGELOG.md | 2 ++ Dangerfile | 6 ++++-- open-weather-ruby-client.gemspec | 5 +++-- 5 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/danger-comment.yml diff --git a/.github/workflows/danger-comment.yml b/.github/workflows/danger-comment.yml new file mode 100644 index 0000000..0b07e97 --- /dev/null +++ b/.github/workflows/danger-comment.yml @@ -0,0 +1,16 @@ +name: Danger Comment + +on: + workflow_run: + workflows: [Danger] + types: [completed] + +permissions: + actions: read + issues: write + pull-requests: write + +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 5a4dba5..6a11b3d 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,19 +1,11 @@ -name: PR Linter -on: [pull_request] +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: - bundler-cache: true - ruby-version: 3.1 - - 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.4" + danger-args: "dry_run --base=origin/master" diff --git a/CHANGELOG.md b/CHANGELOG.md index a36d39c..cd6b7f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### 0.7.0 (Next) +* [#49](https://github.com/dblock/open-weather-ruby-client/pull/49): Migrate Danger to use the `danger-pr-comment` reusable workflow - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/apps/copilot-swe-agent). +* [#49](https://github.com/dblock/open-weather-ruby-client/pull/49): Upgrade danger-changelog to 0.8.0 and danger-toc to 0.2.0 - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/apps/copilot-swe-agent). * Your contribution here. * [#46](https://github.com/dblock/open-weather-ruby-client/pull/46): Added support for the five day forecast API - [@mgm702](https://github.com/mgm702). diff --git a/Dangerfile b/Dangerfile index 3ad7721..f2eee46 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,4 +1,6 @@ # frozen_string_literal: true -toc.check -changelog.check +danger.import_dangerfile(gem: 'danger-pr-comment') + +toc.check! +changelog.check! diff --git a/open-weather-ruby-client.gemspec b/open-weather-ruby-client.gemspec index 35cfc19..3f25cca 100644 --- a/open-weather-ruby-client.gemspec +++ b/open-weather-ruby-client.gemspec @@ -21,8 +21,9 @@ Gem::Specification.new do |s| s.add_dependency 'faraday-multipart' s.add_dependency 'hashie' - s.add_development_dependency 'danger-changelog', '~> 0.4.2' - s.add_development_dependency 'danger-toc', '~> 0.1.3' + s.add_development_dependency 'danger-changelog', '~> 0.8.0' + s.add_development_dependency 'danger-pr-comment' + s.add_development_dependency 'danger-toc', '~> 0.2.0' s.add_development_dependency 'dotenv' s.add_development_dependency 'pry' s.add_development_dependency 'rake'