Skip to content

Commit 9328f31

Browse files
Sync check-go-task with upstream template
1 parent 77013c9 commit 9328f31

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/check-go-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
RESULT="false"
5151
fi
5252
53-
echo "::set-output name=result::$RESULT"
53+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5454
5555
check-errors:
5656
name: check-errors (${{ matrix.module.path }})

Taskfile.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ vars:
1010
DEFAULT_GO_MODULE_PATH: ./
1111
DEFAULT_GO_PACKAGES:
1212
sh: |
13-
echo $(cd {{default "./" .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
13+
echo $(
14+
cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} &&
15+
go list ./... | tr '\n' ' ' ||
16+
echo '"ERROR: Unable to discover Go packages"'
17+
)
1418
# build vars
1519
COMMIT:
1620
sh: echo "$(git log --no-show-signature -n 1 --format=%h)"
@@ -86,7 +90,7 @@ tasks:
8690
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml
8791
go:build:
8892
desc: Build the Go code
89-
dir: '{{default "./" .GO_MODULE_PATH}}'
93+
dir: "{{.DEFAULT_GO_MODULE_PATH}}"
9094
cmds:
9195
- go build -v {{.LDFLAGS}}
9296

@@ -103,21 +107,21 @@ tasks:
103107
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
104108
go:fix:
105109
desc: Modernize usages of outdated APIs
106-
dir: '{{default "./" .GO_MODULE_PATH}}'
110+
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
107111
cmds:
108112
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
109113

110114
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
111115
go:format:
112116
desc: Format Go code
113-
dir: '{{default "./" .GO_MODULE_PATH}}'
117+
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
114118
cmds:
115119
- go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
116120

117121
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
118122
go:lint:
119123
desc: Lint Go code
120-
dir: '{{default "./" .GO_MODULE_PATH}}'
124+
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
121125
cmds:
122126
- |
123127
if ! which golint &>/dev/null; then
@@ -156,7 +160,7 @@ tasks:
156160
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
157161
go:vet:
158162
desc: Check for errors in Go code
159-
dir: '{{default "./" .GO_MODULE_PATH}}'
163+
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
160164
cmds:
161165
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
162166

0 commit comments

Comments
 (0)