Skip to content

Commit 63fa6c8

Browse files
committed
Migrate Danger to use danger-pr-comment workflow.
1 parent 4fba876 commit 63fa6c8

8 files changed

Lines changed: 32 additions & 26 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Danger Comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [Danger]
6+
types: [completed]
7+
8+
jobs:
9+
comment:
10+
uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0
11+
secrets: inherit

.github/workflows/danger.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
name: PR Linter
2-
on: [pull_request]
1+
name: Danger
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
37
jobs:
48
danger:
5-
runs-on: ubuntu-latest
6-
env:
7-
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger
8-
steps:
9-
- uses: actions/checkout@v2
10-
with:
11-
fetch-depth: 0
12-
- uses: ruby/setup-ruby@v1
13-
with:
14-
ruby-version: 3.3.6
15-
bundler-cache: true
16-
- run: |
17-
# the personal token is public, this is ok, base64 encode to avoid tripping Github
18-
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
19-
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
9+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
10+
secrets: inherit
11+
with:
12+
ruby-version: '3.4'
13+
bundler-cache: true

.github/workflows/rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
- name: Set up Ruby
99
uses: ruby/setup-ruby@v1
1010
with:
11-
ruby-version: 3.3.6
11+
ruby-version: 3.4.1
1212
bundler-cache: true
1313
- run: bundle exec rubocop

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
ruby-version:
9-
- 3.3.6
9+
- 3.4.1
1010
steps:
1111
- uses: actions/checkout@v3
1212
- name: Set up Ruby

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### 0.6.0 (Next)
22

3+
* [#38](https://github.com/dblock/fue/pull/38): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock).
34
* [#37](https://github.com/dblock/fue/pull/36): Added fetching of e-mails from `Signed-off-by` and `--[no-]signed-off-by` - [@dblock](https://github.com/dblock).
45
* [#36](https://github.com/dblock/fue/pull/36): Added `--[no-]reply` to exclude `@users.noreply.github.com` email addresses - [@dblock](https://github.com/dblock).
56
* Your contribution here.

Dangerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# frozen_string_literal: true
22

3-
toc.check!
3+
danger.import_dangerfile(gem: 'danger-pr-comment')
4+
45
changelog.check!
6+
toc.check!

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ source 'http://rubygems.org'
55
gemspec
66

77
group :development, :test do
8+
gem 'danger', require: false
9+
gem 'danger-changelog', require: false
10+
gem 'danger-pr-comment', require: false
11+
gem 'danger-toc', require: false
812
gem 'rake'
913
gem 'recursive-open-struct'
1014
gem 'rspec'

Gemfile.danger

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)