Commit 32f9119
committed
Use project Go version for generating website content
The "Deploy Website" (Cobra, versioned, MkDocs, Poetry) template is used to generate and publish a documentation website
for projects based on the Cobra command line application framework.
Command line reference pages are generated from the project's Go codebase.
Previously, the default version of Go from the GitHub Actions runner machine was used for generating the documentation
content. A recent update of this default Go version from 1.17 to 1.20 caused the generation process to fail during the
workflow runs in some projects that use older Go versions:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x83c1a6]
goroutine 1 [running]:
debug/elf.(*Section).ReadAt(0xc0001be000?, {0xc0001ce000?, 0x24?, 0x23?}, 0x23?)
<autogenerated>:1 +0x26
archive/zip.readDirectoryEnd({0xa37480, 0xc0000af580}, 0x210)
/opt/hostedtoolcache/go/1.20.3/x64/src/archive/zip/reader.go:581 +0xf5
archive/zip.(*Reader).init(0xc000137500, {0xa37480?, 0xc0000af580}, 0x210)
/opt/hostedtoolcache/go/1.20.3/x64/src/archive/zip/reader.go:124 +0x5c
archive/zip.NewReader({0xa37480, 0xc0000af580}, 0x210)
/opt/hostedtoolcache/go/1.20.3/x64/src/archive/zip/reader.go:103 +0x5e
github.com/daaku/go%2ezipexe.zipExeReaderElf({0xa38040?, 0xc0000140f0}, 0xdc51bf)
/home/runner/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:128 +0x8b
github.com/daaku/go%2ezipexe.NewReader({0xa38040, 0xc0000140f0}, 0x0?)
/home/runner/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:48 +0x98
github.com/daaku/go%2ezipexe.OpenCloser({0xc0000822a0?, 0xc0000e5720?})
/home/runner/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:30 +0x57
github.com/cmaglie/go%2erice.init.0()
/home/runner/go/pkg/mod/github.com/cmaglie/go.rice@v1.0.3/appended.go:42 +0x65
task: Failed to run task "go:cli-docs": exit status 2
```
This error, and the general fragility that comes from not controlling the Go version, is avoided by configuring the
workflow to use the specific version of Go that is used for development and validation of the project.1 parent ac9f2e7 commit 32f9119
File tree
2 files changed
+11
-0
lines changed- workflow-templates
2 files changed
+11
-0
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
0 commit comments