wangyoucao577 / go-release-action

Automatically publish Go binaries to Github Release Assets through Github Action.
https://github.com/marketplace/actions/go-release-binaries
MIT License
485 stars 75 forks source link

Don't run as root but as `id -u` #175

Open babariviere opened 1 month ago

babariviere commented 1 month ago

Since we are using a self-hosted runner, we are not using root as the default user for our workflows.

Currently, this tool is breaking actions/checkout since it cannot clear the files created by this workflow.

Example error:

Deleting the contents of '/home/actions-runner/org/repo'
Error: File was unable to be removed Error: EACCES: permission denied, unlink '/home/actions-runner/org/repo/build-artifacts-1720079675/my-cmd'

To fix this, this workflow should use the default user by using uid from id -u.

wangyoucao577 commented 1 month ago

Is there any side effect? PR is welcome!

babariviere commented 1 month ago

@wangyoucao577 New folders with use the new user ID, and as there is no collision with previous builds, there shouldn't be any side effects.