Compare commits
1 commit
main
...
trstringer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ebd1205a6 |
3 changed files with 9 additions and 3 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
|
@ -22,3 +22,5 @@ jobs:
|
||||||
VERSION: latest
|
VERSION: latest
|
||||||
- name: Test
|
- name: Test
|
||||||
run: make test
|
run: make test
|
||||||
|
- name: Lint
|
||||||
|
run: make lint
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -19,3 +19,7 @@ push:
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
go test -v .
|
go test -v .
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint:
|
||||||
|
docker run --rm -v $$(pwd):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run -v
|
||||||
|
|
|
||||||
6
main.go
6
main.go
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func handleInterrupt(client *github.Client, ctx context.Context, apprv *approvalEnvironment) {
|
func handleInterrupt(ctx context.Context, client *github.Client, apprv *approvalEnvironment) {
|
||||||
newState := "closed"
|
newState := "closed"
|
||||||
closeComment := "Workflow cancelled, closing issue."
|
closeComment := "Workflow cancelled, closing issue."
|
||||||
fmt.Println(closeComment)
|
fmt.Println(closeComment)
|
||||||
|
|
@ -158,8 +158,8 @@ func main() {
|
||||||
select {
|
select {
|
||||||
case exitCode := <-commentLoopChannel:
|
case exitCode := <-commentLoopChannel:
|
||||||
os.Exit(exitCode)
|
os.Exit(exitCode)
|
||||||
case _ = <-killSignalChannel:
|
case <-killSignalChannel:
|
||||||
handleInterrupt(client, ctx, apprv)
|
handleInterrupt(ctx, client, apprv)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue