File tree Expand file tree Collapse file tree 4 files changed +79
-1
lines changed
Expand file tree Collapse file tree 4 files changed +79
-1
lines changed Original file line number Diff line number Diff line change 1818 with :
1919 fetch-depth : 0
2020
21+ - name : Setup Go
22+ uses : actions/setup-go@v3
23+ with :
24+ go-version : " >=1.18.0"
25+ check-latest : true
26+
2127 - name : Install Importer
22- run : brew install upsidr/tap/ importer
28+ run : go install github.com/ upsidr/importer/cmd/ importer@v0.1.4
2329
2430 - name : Run Importer against all *.md files
2531 run : find . -name '*.md' -exec importer update {} \;
Original file line number Diff line number Diff line change 1313
1414# Dependency directories (remove the comment below to include it)
1515# vendor/
16+
17+ # Built binary
18+ merge-gatekeeper
Original file line number Diff line number Diff line change 1+ TOKEN =${GITHUB_TOKEN}
2+ REF =main
3+ REPO =upsidr/merge-gatekeeper
4+ IGNORED =""
5+
6+ go-build :
7+ GO111MODULE=on LANG=en_US.UTF-8 CGO_ENABLED=0 go build ./cmd/merge-gatekeeper
8+
9+ go-run : go-build
10+ ./merge-gatekeeper validate --token=$(TOKEN ) --ref $(REF ) --repo $(REPO ) --ignored " $( IGNORED) "
11+
12+ docker-build :
13+ docker build -t merge-gatekeeper:latest .
14+
15+ docker-run : docker-build
16+ docker run --rm -it --name merge-gatekeeper merge-gatekeeper:latest validate --token=$(TOKEN ) --ref $(REF ) --repo $(REPO ) --ignored " $( IGNORED) "
17+
18+ test :
19+ go test ./...
Original file line number Diff line number Diff line change 1+ # Working with Merge Gatekeeper locally
2+
3+ ## Requirements
4+
5+ - [ ` go ` >= 1.16.7] ( https://go.dev/doc/install )
6+ - [ A valid github token with ` repo ` permissions] ( https://github.com/settings/tokens )
7+ - [ make] ( https://en.wikipedia.org/wiki/Make_(software) )
8+
9+ ## Useful but not required
10+
11+ - [ ` docker ` ] ( https://docs.docker.com/engine/install/ )
12+ - required for building and running via docker
13+
14+ ## Building Merge Gatekeeper
15+
16+ Using the [ ` Makefile ` ] ( ./../Makefile ) run the following to build:
17+ ``` bash
18+ # build go binary
19+ make go-build
20+
21+ # build docker container
22+ make docker-build
23+ ```
24+
25+ ## Running Merge Gatekeeper
26+
27+ it is recommend to export you [ github token with ` repo ` permissions] ( https://github.com/settings/tokens ) to the environment using
28+ ``` bash
29+ export GITHUB_TOKEN=" your token"
30+ ```
31+ otherwise, you will need to pass your token in via
32+ ``` bash
33+ GITHUB_TOKEN=" your token" make go-run
34+ ```
35+
36+ Using the [ ` Makefile ` ] ( ./../Makefile ) run the following to run:
37+ ``` bash
38+ # build and run go binary
39+ make go-run
40+
41+ # build and run docker container
42+ make docker-run
43+ ```
44+
45+ ## Testing
46+ To test, use the makefile:
47+
48+ ``` bash
49+ make test
50+ ```
You can’t perform that action at this time.
0 commit comments