diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bba942f..8bb5b57 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,8 @@ on: branches: - main pull_request: +env: + GOLANGCI_LINT_VERSION: v1.51.2 jobs: lint: runs-on: ubuntu-latest @@ -11,11 +13,11 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.19.x + go-version: 1.20.x - run: go version - run: diff -u <(echo -n) <(gofmt -d .) - name: Run golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.51.2 + version: ${{ env.GOLANGCI_LINT_VERSION }} args: --verbose diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8efe72..d8c6c50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: test: strategy: matrix: - go-version: [1.19.x, 1.20.x] + go-version: [1.20.x] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: diff --git a/Makefile b/Makefile index 80d0a2f..2ec4b20 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ export GOBIN := $(MAKEFILE_PATH)/bin PATH := $(GOBIN):$(PATH) +GOLANGCI_LINT_VERSION=$(shell awk '/GOLANGCI_LINT_VERSION:/ { print $$2 }' .github/workflows/lint.yml) + .PHONY: all all: clean format build lint test @@ -26,7 +28,7 @@ test: .PHONY: lint lint: @echo lint - @go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) @$(GOBIN)/golangci-lint run .PHONY: format diff --git a/README.md b/README.md index 982bac2..5400eab 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The tool to import commits from private GitLab to separate repo. Can be used to # Getting Started -1. Download and install [Go 1.19](https://go.dev/dl/). +1. Download and install [Go 1.20](https://go.dev/dl/). 2. Install the program by running the command in a shell: ```shell go install github.com/alexandear/import-gitlab-commits@latest diff --git a/go.mod b/go.mod index 7a65a41..9d2267b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/alexandear/import-gitlab-commits -go 1.19 +go 1.20 require ( github.com/go-git/go-git/v5 v5.2.0