Local workflows fail for private repos #91
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Thanks for the quick fix to support local workflows! Unfortunately I run into another issue while using them on one of my private repos:
This happens in the
Set up job
step and nothing else runs. Based on the output from other workflows which don't use local workflows, I guess theGITEA_TOKEN
environment variable isn't set until later in the workflow and probably needs to be set early for the first set of clones in case they are private.Thanks for your report! I'll try to fix it.
I did some digging and it looks like it's a simple fix; the
runner.Config
struct has aToken
field which isn't set here: https://gitea.com/gitea/act_runner/src/branch/main/runtime/task.go#L214.The token is already fetched above so just setting:
seems to be enough to fix it!
Unfortunately I immediately ran into another problem: the
inputs
in the reusable workflow are unset. My workflow looks something like this:With a calling workflow like this:
The
manifest
variable resolves to/manifest.yaml
instead ofmypackage/manifest.yaml
.It looks like that
runner.Config
struct also has aninputs
field which might fix this, but I'm not sure where the value would come from.I think this is a workaround to reuse a workflow from the same repository. But when we try to reuse a workflow from another private repository, I guess it won't work because the token cannot be authenticated by other repositories.
This is another bug. I'll do more tests to check.
Good point, although I think this would then be consistent with Github's behavior when it comes to tokens (as far as I know the token that's automatically generated is scoped only to the current repo). Maybe it should first look for a user-managed secret called GITEA_TOKEN and fallback to the default token if it doesn't exist?