Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions workflow-templates/assets/check-go-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ tasks:
Lint Go code
Environment variable parameters:
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
- GOLANGCI_LINT_BIN: Path to the golangci-lint binary (default: ${PWD}/.bin/golangci-lint).

dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
silent: true
vars:
GOLANGCI_LINT_BIN: '{{default "${PWD}/.bin/golangci-lint" .GOLANGCI_LINT_BIN}}'
cmds:
- |
if
! which golangci-lint \
! which "{{.GOLANGCI_LINT_BIN}}" \
&>/dev/null
then
echo "golangci-lint not installed or not in PATH."
echo "Please install: https://golangci-lint.run/usage/install/#local-installation"
exit 1
fi
- golangci-lint run
- '{{.GOLANGCI_LINT_BIN}} run'
1 change: 1 addition & 0 deletions workflow-templates/check-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
- name: Check style
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
GOLANGCI_LINT_BIN: ${{ github.workspace }}/.bin/golangci-lint
run: |
go tool \
github.com/go-task/task/v3/cmd/task \
Expand Down
Loading