A Danger plugin that runs and prints SwiftInfo results to pull requests.
Requires SwiftInfo 2.3.1 or newer.
Just add the gem to your Gemfile:
gem 'danger-SwiftInfo'To use this plugin, you need to modify both your Dangerfile and your SwiftInfo's Infofile.
Call swiftinfo.run with the path to your SwiftInfo binary as an argument. (inside Pods if CocoaPods was used or just swiftinfo if Homebrew was used)
swiftinfo.run './Pods/SwiftInfo/bin/swiftinfo'To print the final output to Danger, call api.print(output) from your Infofile.
Note that when ran from this plugin, SwiftInfo will be executed with the -pullRequest -s arguments which can be inspected and used as a condition. This logic is abstracted under the isInPullRequestMode boolean, which you can use to extract different providers in Danger runs and prevent saving the output, for example.
if isInPullRequestMode {
// The specific Danger flow
api.print(output: output)
} else {
// The regular release flow
api.sendToSlack(output: output, webhookUrl: url)
api.save(output: output)
}- Clone this repo
- Run
bundle installto setup dependencies. - Run
bundle exec rake specto run the tests. - Use
bundle exec guardto automatically have tests run as you make changes. - Make your changes.
