From 39f4aa6495737b3c2ac82b1a2d4cf964dcb551bd Mon Sep 17 00:00:00 2001 From: Alex ATorres Date: Mon, 12 Sep 2022 10:52:50 +0200 Subject: [PATCH] refactor(golangci): rm temporary lint from github workflows --- .github/workflows/ci-app.yml | 56 +++++++++++++------------- .github/workflows/ci-docker.yml | 2 +- .github/workflows/generate-release.yml | 2 +- TaskFile.yml | 2 +- app/cli/pkg/clients/github/github.go | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci-app.yml b/.github/workflows/ci-app.yml index f486277..b3f6588 100644 --- a/.github/workflows/ci-app.yml +++ b/.github/workflows/ci-app.yml @@ -1,5 +1,5 @@ --- -name: 'CI: App' +name: 'CI: CLI' on: [push, pull_request] @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.platform }} defaults: run: - working-directory: app/microservice + working-directory: app/cli steps: - name: Checkout Repository @@ -48,33 +48,33 @@ jobs: run: | go test -v -cover -race -timeout 120s ./... - lint: - name: Linter - needs: [ci] - - runs-on: ubuntu-latest - defaults: - run: - working-directory: app/microservice - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - - name: Run Linter - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2 - /home/runner/go/bin/golangci-lint --version - /home/runner/go/bin/golangci-lint run ./... --color always -v +# lint: +# name: Linter +# needs: [ci] +# +# runs-on: ubuntu-latest +# defaults: +# run: +# working-directory: app/cli +# +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v2 +# +# - name: Setup Go +# uses: actions/setup-go@v3 +# with: +# go-version: 1.18 +# +# - name: Run Linter +# run: | +# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2 +# /home/runner/go/bin/golangci-lint --version +# /home/runner/go/bin/golangci-lint run ./... --color always -v build-binary: name: Build Binary - needs: [ci, lint] + needs: [ci] strategy: matrix: @@ -84,7 +84,7 @@ jobs: runs-on: ${{ matrix.platform }} defaults: run: - working-directory: app/microservice + working-directory: app/cli steps: - name: Checkout Repository @@ -98,7 +98,7 @@ jobs: - name: Go build run: | go mod tidy - go build -v -o dist/amigo-cli-ci + go build -v -o dist/glonner - name: Setup GoReleaser run: | diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index cc050cd..a2896f3 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -37,4 +37,4 @@ jobs: - name: Build id: build-and-run run: | - docker build -t helloworld-svc:latest . + docker build -t glonner:latest . diff --git a/.github/workflows/generate-release.yml b/.github/workflows/generate-release.yml index cfb3b65..9aabd4a 100644 --- a/.github/workflows/generate-release.yml +++ b/.github/workflows/generate-release.yml @@ -7,7 +7,7 @@ on: defaults: run: shell: bash - working-directory: app/microservice + working-directory: app/cli permissions: contents: write diff --git a/TaskFile.yml b/TaskFile.yml index 113f4a2..7fc1965 100644 --- a/TaskFile.yml +++ b/TaskFile.yml @@ -64,7 +64,7 @@ tasks: dir: app/cli cmds: - goreleaser check - - goreleaser release --rm-dist + - export GITHUB_TOKEN=${GITHUB_TOKEN} && goreleaser release --rm-dist pre-commit: cmds: diff --git a/app/cli/pkg/clients/github/github.go b/app/cli/pkg/clients/github/github.go index 6d7f2c7..3b1d571 100644 --- a/app/cli/pkg/clients/github/github.go +++ b/app/cli/pkg/clients/github/github.go @@ -50,7 +50,7 @@ func (g Client) GetAuth(token string) (map[string][]string, error) { auth := make(map[string][]string) if token == "" { - return nil, errors.New("Token is required (use --token or set GITHUB_TOKEN env var)") + return nil, errors.New("token is required (use --token or set GITHUB_TOKEN env var") } auth["Authorization"] = []string{fmt.Sprintf("token %s", token)}