-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloaded go source is not cleaned up - repository reports "dirty" #143
Comments
rustydb
added a commit
to rustydb/go-release-action
that referenced
this issue
Dec 1, 2023
Downloads go source into a temporary location, outside of the cloned project source repository. This keeps the cloned repository clean by reporting no new files or changes in `git status`.
rustydb
added a commit
to Cray-HPE/gru
that referenced
this issue
Dec 1, 2023
The GitHub action we use is downloading the go source code to the project's checked out clone. This is causing our `GitTreeState` to always report as "dirty." The file in question is always named `go-linux.tar.gz` (even on Windows and Mac), since this is incorrect we can preemptively remove the tar using a glob.
rustydb
added a commit
to Cray-HPE/gru
that referenced
this issue
Dec 1, 2023
The GitHub action we use is downloading the go source code to the project's checked out clone. This is causing our `GitTreeState` to always report as "dirty." The file in question is always named `go-linux.tar.gz` (even on Windows and Mac), since this is incorrect we can preemptively remove the tar using a glob.
rustydb
added a commit
to Cray-HPE/gru
that referenced
this issue
Dec 1, 2023
The GitHub action we use is downloading the go source code to the project's checked out clone. This is causing our `GitTreeState` to always report as "dirty." The file in question is always named `go-linux.tar.gz` (even on Windows and Mac), since this is incorrect we can preemptively remove the tar using a glob.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
'ghcr.io/wangyoucao577/go-release-action:v1.40'
, the downloaded go source is not cleaned up and left in the repository clone.Our Go app's build appends "-dirty" to the version string if uncommitted files exist. This has been handy to validate whether the build was from a developer or a clean checkout.
The problem can be observed here:
go-linux.tar.gz
appearing ingit status -s
LDFLAG
reporting the undesired value of "dirty":github.com/Cray-HPE/gru/pkg/version.GitTreeState='dirty''
I've worked around this by adding
rm -rf go-*.tar.gz
to apre_command
for the action parameters. Alternatively I could've added this to our.gitignore
. Doing this results in a "clean" report:LDFLAG
reporting the desired "clean" value:github.com/Cray-HPE/gru/pkg/version.GitTreeState='clean'
It seems more proper that the process responsible for downloading the new file also be responsible for removing or hiding it. Ensuring that the repo clone is clean, and unadulterated.
The text was updated successfully, but these errors were encountered: