[GH-ISSUE #1069] Enhancement: --version and --bugreport should report tag or commit hash for compiled Act instances #620

Closed
opened 2026-03-01 21:45:00 +03:00 by kerem · 6 comments
Owner

Originally created by @maxsu on GitHub (Mar 23, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1069

Enhancement

When act is built from scratch or installed with go install, it would be helpful for the --version and --bug-report flags to report the tag and/or commit hash (and indicate act was compiled).

Existing Behavior

--bug-report leaves the version field empty, and the --version flag is not compiled:

$ act --version
Error: unknown flag: --version
$ act --bug-report
act version:
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
.
.
.

This leaves some room for surprise, and requires an workaround (see below).

System information

Act version: 0.2.26
Install route: go install github.com/nektos/act@latest
OS: Pop_OS 21.10
Arch: x86-64

Workaround

I can find the tag like so:

$ ls $GO_PATH/pkg/mod/github.com/nektos
act@v0.2.26
Originally created by @maxsu on GitHub (Mar 23, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1069 ## Enhancement When act is built from scratch or installed with `go install`, it would be helpful for the `--version` and `--bug-report` flags to report the tag and/or commit hash (and indicate act was compiled). ## Existing Behavior `--bug-report` leaves the version field empty, and the `--version` flag is not compiled: ``` $ act --version Error: unknown flag: --version ``` ``` $ act --bug-report act version: GOOS: linux GOARCH: amd64 NumCPU: 8 . . . ``` This leaves some room for surprise, and requires an workaround (see below). ## System information Act version: 0.2.26 Install route: `go install github.com/nektos/act@latest` OS: Pop_OS 21.10 Arch: x86-64 ## Workaround I can find the tag like so: ```bash $ ls $GO_PATH/pkg/mod/github.com/nektos act@v0.2.26 ```
kerem 2026-03-01 21:45:00 +03:00
Author
Owner

@maxsu commented on GitHub (Mar 23, 2022):

Is the existing behavior designed to encourage people to file bug reports against official versions?

In that case, consider the requested feature makes it easier to comply with the issue template requirement:

if you've built `act` yourself, please provide commit hash

There are good and bad sides to this:


Pros:
+ The feature makes it easier to report bugs
+ This may increase the rate of bug reports
+ More of these reports may be in compliance /w the issue template

Cons: 
- The feature lets inexperienced users comply /w the issue template
- ... So the additional issues may otherwise be of lower quality
<!-- gh-comment-id:1075973220 --> @maxsu commented on GitHub (Mar 23, 2022): Is the existing behavior designed to encourage people to file bug reports against official versions? In that case, consider the requested feature makes it easier to comply with the issue template requirement: if you've built `act` yourself, please provide commit hash There are good and bad sides to this: ```diff Pros: + The feature makes it easier to report bugs + This may increase the rate of bug reports + More of these reports may be in compliance /w the issue template Cons: - The feature lets inexperienced users comply /w the issue template - ... So the additional issues may otherwise be of lower quality ```
Author
Owner

@catthehacker commented on GitHub (Mar 23, 2022):

It already provides version, but you have to supply it via ldflags

<!-- gh-comment-id:1076010830 --> @catthehacker commented on GitHub (Mar 23, 2022): It already provides version, but you have to supply it via ldflags
Author
Owner

@maxsu commented on GitHub (Mar 23, 2022):

@catthehacker thanks for the lead!

I can now set Act to a very special version:

$ go install --ldflags "-X main.version=6.6.6.😈" github.com/nektos/act@latest
$ act --version
act version 6.6.6.😈

The project has two ways of auto-setting the version:

  1. Manual builds via Makefile: Makefile lines 2 and 26 set the version as described in this article. If the user is not at a tag, the logic in line 2 gives us a commit hash.

  2. Github action: .github/actions/release.yml runs goreleaser/goreleaser-action@v1. That takes the argument version: latest and just does the right thing (goreleaser/github.ts:L25-L27)

<!-- gh-comment-id:1076896273 --> @maxsu commented on GitHub (Mar 23, 2022): @catthehacker thanks for the lead! I can now set Act to a very special version: ```bash $ go install --ldflags "-X main.version=6.6.6.😈" github.com/nektos/act@latest $ act --version act version 6.6.6.😈 ``` The project has two ways of auto-setting the version: 1. Manual builds via Makefile: `Makefile` lines [2](https://github.com/nektos/act/blob/master/Makefile#L2) and [26](https://github.com/nektos/act/blob/2bb3e74616f86ece6a11cd854ad54701542410fd/Makefile#L26) set the version as described in [this article](https://vincent.bernat.ch/en/blog/2019-makefile-build-golang). If the user is not at a tag, the logic in line 2 gives us a commit hash. 2. Github action: `.github/actions/release.yml` runs `goreleaser/goreleaser-action@v1`. That takes the argument `version: latest` and just does the right thing ([goreleaser/github.ts:L25-L27](https://github.com/goreleaser/goreleaser-action/blob/master/src/github.ts#L25-L27))
Author
Owner

@maxsu commented on GitHub (Mar 23, 2022):

@catthehacker I propose that go install should also set the correct version. go install is one of the documented install methods, so without this, less experienced users (like yours truly) end up with non-versioned installs.

<!-- gh-comment-id:1076897383 --> @maxsu commented on GitHub (Mar 23, 2022): @catthehacker I propose that `go install` should also set the correct version. `go install` is one of the documented install methods, so without this, less experienced users (like yours truly) end up with non-versioned installs.
Author
Owner

@catthehacker commented on GitHub (Mar 24, 2022):

The expectation is that people who have Go will know why and how to version it, but I guess if someone knows Go they also know about go install so I'll remove that instruction.

<!-- gh-comment-id:1077925081 --> @catthehacker commented on GitHub (Mar 24, 2022): The expectation is that people who have Go will know why and how to version it, but I guess if someone knows Go they also know about `go install` so I'll remove that instruction.
Author
Owner

@maxsu commented on GitHub (Apr 20, 2022):

I thought about this, and realize I was projecting expectations set by boyter's scc project:

  1. scc hardcodes the version in their CLI entrypoint
  2. scc increments the version through manual version bump commits
  3. scc promotes go install as its first deployment option.

You have implemented points 1 and 2 in PR #1070. Thank you!

You have also deprecated go install, in wiki ad675d and #1123.

I will admit first class go install has a special place in my heart as a promoter of go - Boyter's project is the reason I learned how to install go, and so I consider it an evangelist for go.

But that alone does not mean my expectation is right. To your points:

  • I agree supporting go install can introduce support overhead
  • I concur that act meets a much more complex need than scc, so its users are more likely to know go install.
    • Moreover, PR 1070 solves the potential issue in the latter case

Therefore I am satisfied with your resolution. Thank you!

<!-- gh-comment-id:1104469000 --> @maxsu commented on GitHub (Apr 20, 2022): I thought about this, and realize I was projecting expectations set by boyter's [scc project](https://github.com/boyter/scc/): 1. `scc` hardcodes the version in their [CLI entrypoint](https://github.com/boyter/scc/blob/d46832f83af4b22466ea57261a13cc5b91363268/processor/processor.go#L22) 2. `scc` increments the version through manual [version bump commits](https://github.com/boyter/scc/commit/d46832f83af4b22466ea57261a13cc5b91363268) 3. `scc` promotes `go install` as its first deployment option. You have implemented points 1 and 2 in PR #1070. Thank you! You have also deprecated go install, in [wiki ad675d](https://github.com/nektos/act/wiki/Installation/_compare/41ad44b343fb60e31bb4985cb48daaecf16112c4...ad675d579a321ca59352bfb803678da62f4f977e) and #1123. I will admit first class `go install` has a special place in my heart as a promoter of go - Boyter's project is the reason I learned how to install go, and so I consider it an evangelist for go. But that alone does not mean my expectation is right. To your points: - I agree supporting `go install` can introduce support overhead - I concur that `act` meets a much more complex need than `scc`, so its users are more likely to know `go install`. - Moreover, PR 1070 solves the potential issue in the latter case Therefore I am satisfied with your resolution. Thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#620
No description provided.