diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a44d823..ad1ba3b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,3 +22,5 @@ jobs: VERSION: latest - name: Test run: make test + - name: Lint + run: make lint diff --git a/Makefile b/Makefile index 3aadb49..3ec553a 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,7 @@ push: .PHONY: test test: go test -v . + +.PHONY: lint +lint: + docker run --rm -v $$(pwd):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run -v diff --git a/main.go b/main.go index 348bc70..b8d4994 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "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" closeComment := "Workflow cancelled, closing issue." fmt.Println(closeComment) @@ -158,8 +158,8 @@ func main() { select { case exitCode := <-commentLoopChannel: os.Exit(exitCode) - case _ = <-killSignalChannel: - handleInterrupt(client, ctx, apprv) + case <-killSignalChannel: + handleInterrupt(ctx, client, apprv) os.Exit(1) } }