Skip to content

Commit 1b42f29

Browse files
committed
Flesh out README.md
1 parent ccc05f3 commit 1b42f29

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1-
### Installation
1+
# Danger in Go
22

3-
`go install github.com/moolmanruan/danger-go/cmd/danger-go@latest`
3+
This is a Go version of the popular Danger tool.
4+
5+
## Installation of command line tool
6+
7+
```shell
8+
go install github.com/moolmanruan/danger-go/cmd/danger-go@latest
9+
yarn global add danger
10+
```
11+
12+
Requires [Danger JS](https://danger.systems/js) to run properly.
13+
14+
## Integrate into project
15+
16+
1. Create a new directory to house the *dangerfile.go* file. This repo uses `build/ci`.
17+
2. Add a `dangerfile.go` to the directory with the following contents:
18+
```go
19+
package main
20+
21+
import (
22+
"fmt"
23+
24+
"github.com/moolmanruan/danger-go"
25+
"github.com/moolmanruan/danger-go/danger-js"
26+
)
27+
28+
func Run(d *danger.T, pr dangerJs.DSL) {
29+
d.Message("danger-go is running!", "", 0)
30+
}
31+
```
32+
3. Run the following in the directory:
33+
```shell
34+
go mod init dangerfile
35+
go get github.com/moolmanruan/danger-go
36+
go mod tidy
37+
```
38+
39+
## Running danger-go locally
40+
41+
The `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`.
42+
43+
## CI integration
44+
45+
### GitHub Actions
46+
See `.github/workflows/main.yml` as a reference.

0 commit comments

Comments
 (0)