A danger-swift plug-in to check if the PR matches a specific workflow (e.g. Git-Flow)
-
Add dependency package to your
Package.swift
file which you import danger-swift// swift-tools-version:5.5 ... let package = Package( ... dependencies: [ ... // Danger Plugins .package(name: "DangerSwiftEda", url: "https://www.github.com/yumemi-inc/danger-swift-eda.git", from: "0.1.0"), ... ], ... )
-
Add the correct import to your
Dangerfile.swift
fileimport DangerSwiftEda
Marathon (Tool Deprecated)
-
Just add the dependency import to your
Dangerfile.swift
file like this:import DangerSwiftEda // package: https://github.com/yumemi-inc/danger-swift-eda.git
-
Setup a configuration based on the workflow you'd like to perform (currently only Git-Flow supported)
let configuration = GitFlowCheckConfiguration( // ... )
TIPS: We also have
GitFlowCheckConfiguration.default
if you just want to use default configuration. -
Perform the workflow check with
eda.checkPR
method which is available forDangerDSL
instancesdanger.eda.checkPR(workflow: .gitFlow(configuration)) // Assume you have initialized `danger` by code like `let danger = Danger()`
Code above will make danger producing markdown messages like below
Checking Item Result Base Branch Check 🎉 Merge Commit Non-Existence Check 🎉 Diff Volume Check 🤔 ChangeLog Modification Check 🤔
Warnings ⚠️ This PR doesn't contain any modifications in CHANGELOG.md. Please consider to update the ChangeLog. ⚠️ There's too much diff. Please make PRs smaller.