Local workflows fail for private repos #91
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 jobstep and nothing else runs. Based on the output from other workflows which don't use local workflows, I guess the
GITEA_TOKENenvironment 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.Configstruct has a
Tokenfield 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
inputsin the reusable workflow are unset. My workflow looks something like this:
With a calling workflow like this:
manifestvariable resolves to
It looks like that
runner.Configstruct also has an
inputsfield 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?