This is a Go version of the popular Danger tool.
go install github.com/moolmanruan/danger-go/cmd/danger-go@latest
yarn global add dangerRequires Danger JS to run properly.
- Create a new directory to house the dangerfile.go file. This repo uses
build/ci. - Add a
dangerfile.goto the directory with the following contents:
package main
import (
"fmt"
"github.com/moolmanruan/danger-go"
)
func Run(d *danger.T, pr danger.DSL) {
d.Message("danger-go is running!", "", 0)
}- Run the following in the directory:
go mod init dangerfile
go get github.com/moolmanruan/danger-go
go mod tidyThe danger-go command line tool supports local, pr, and ci commands. danger-go wraps the corresponding danger (js) commands, so to get information about flags, run danger <command> --help.
See .github/workflows/main.yml as a reference.