diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 66f1188..2107d29 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,21 +1,21 @@ name: danger - -on: [pull_request] - +on: pull_request jobs: danger: + name: Dangerfile runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger steps: - name: Checkout uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + with: + fetch-depth: 0 + - uses: ruby/setup-ruby@v1 with: ruby-version: "2.6.2" bundler-cache: true - - uses: MeilCli/danger-action@v5 - with: - danger_file: "Dangerfile" - danger_id: "danger-pr" - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: | + # Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub + TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) + DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 228dd6b..ebdaba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ ### Changelog -#### 0.2.1 (Next) +#### 0.3.0 (Next) * [#4](https://github.com/slack-ruby/slack-ruby-bot-server-mailchimp/pull/4): Replaced Travis-CI with GitHub Actions - [@dblock](https://github.com/dblock). +* [#3](https://github.com/slack-ruby/slack-ruby-bot-server-mailchimp/pull/3): Fix: invalid logger reference - [@dblock](https://github.com/dblock). * Your contribution here. #### 0.2.0 (2019/4/6) diff --git a/Dangerfile b/Dangerfile index 4642bfe..10c6cd2 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1 +1,3 @@ +# frozen_string_literal: true + danger.import_dangerfile(gem: 'slack-ruby-danger') diff --git a/Gemfile b/Gemfile index c6779e3..750ca3d 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,3 @@ group :development, :test do gem 'vcr' gem 'webmock' end - -group :test do - gem 'slack-ruby-danger', '~> 0.1.0', require: false -end diff --git a/Gemfile.danger b/Gemfile.danger new file mode 100644 index 0000000..c314069 --- /dev/null +++ b/Gemfile.danger @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +group :test do + gem 'danger-toc', '~> 0.2.0', require: false + gem 'slack-ruby-danger', '~> 0.2.0', require: false +end \ No newline at end of file diff --git a/README.md b/README.md index 6cf5e50..2b25f62 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ Slack Ruby Bot Server Mailchimp Extension A lifecycle extension to [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server) that subscribes new bot users to a Mailchimp mailing list. +# Table of Contents + +- [Usage](#usage) +- [Additional Member Tags](#additional-member-tags) +- [Additional Profile Information](#additional-profile-information) +- [Double Opt-In](#double-opt-in) +- [Copyright & License](#copyright--license) + ### Usage Add 'slack-ruby-bot-server-mailchimp' to Gemfile. diff --git a/lib/slack-ruby-bot-server/mailchimp/lifecycle.rb b/lib/slack-ruby-bot-server/mailchimp/lifecycle.rb index 794f7bd..c0be30f 100644 --- a/lib/slack-ruby-bot-server/mailchimp/lifecycle.rb +++ b/lib/slack-ruby-bot-server/mailchimp/lifecycle.rb @@ -23,7 +23,7 @@ member_tags = member.tags.map { |tag| tag['name'] }.sort tags = (member_tags + tags).uniq if tags == member_tags - SlackRubyBot::Client.logger.debug "Skipping #{profile.email} with identical tags (#{tags.join(', ')}), will not be added to #{SlackRubyBotServer::Mailchimp.config.mailchimp_list_id}, #{team}." + SlackRubyBotServer::Service.logger.debug "Skipping #{profile.email} with identical tags (#{tags.join(', ')}), will not be added to #{SlackRubyBotServer::Mailchimp.config.mailchimp_list_id}, #{team}." next end end @@ -46,5 +46,5 @@ merge_fields: merge_fields ) - SlackRubyBot::Client.logger.info "Subscribed #{profile.email} to #{SlackRubyBotServer::Mailchimp.config.mailchimp_list_id}, #{team}." + SlackRubyBotServer::Service.logger.info "Subscribed #{profile.email} to #{SlackRubyBotServer::Mailchimp.config.mailchimp_list_id}, #{team}." end diff --git a/lib/slack-ruby-bot-server/mailchimp/version.rb b/lib/slack-ruby-bot-server/mailchimp/version.rb index 4c146ac..c5d8e24 100644 --- a/lib/slack-ruby-bot-server/mailchimp/version.rb +++ b/lib/slack-ruby-bot-server/mailchimp/version.rb @@ -1,5 +1,5 @@ module SlackRubyBotServer module Mailchimp - VERSION = '0.2.1'.freeze + VERSION = '0.3.0'.freeze end end diff --git a/slack-ruby-bot-server-mailchimp.gemspec b/slack-ruby-bot-server-mailchimp.gemspec index 5364023..da1a9ed 100644 --- a/slack-ruby-bot-server-mailchimp.gemspec +++ b/slack-ruby-bot-server-mailchimp.gemspec @@ -15,5 +15,5 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'mailchimp_api_v3' - spec.add_dependency 'slack-ruby-bot-server', '>= 0.10.0' + spec.add_dependency 'slack-ruby-bot-server', '>= 2.0.1' end