fix action cloning, set correct server_url for act_runner exec #68
Labels
No Label
duplicate
help wanted
invalid
kind
bug
kind
enhancement
kind
feature
kind
question
proposal
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/act#68
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "tomaszduda23/act:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It might be side effect of #67.
@ -875,2 +875,4 @@
ghc.GraphQLURL = fmt.Sprintf("https://%s/api/graphql", rc.Config.GitHubInstance)
}
{ // Adapt to Gitea
This function always returns at line 844 so I think we don't need these code.
Ah, sorry for that I didn't realize these changes is for
exec
, ignore the comment.I wonder if there's a way to avoid copying. Or we could accept this and deduplicate later.
At the begging I tried to unified the code since it is already in 2 places. The problem is that it seems to be no tests that I could use to verify that things works in intended way. I'm using this for 2 weeks and functionality which I relay on was broken 3 times already. Duplication seems to be better than breaking things that people relay on.
@ -244,6 +240,9 @@ func (ra *remoteAction) IsCheckout() bool {
}
func (ra *remoteAction) GetAvailableCloneURL(actionURLs []string) (string, error) {
if ra.URL != "" {
I think we should not add
ra.URL
toactionsURLs
. Ifra.URL
is not empty, the function should return the clone URL based onra.URL
, no detection is required since this URL is specified by the user.And we also need to remove the line in
github.ServerURL
even if the user has specified it.@ -257,0 +256,4 @@
// TODO
// 1. login page returns 200 so runner things that repository exists
// 2. use auth token to access private repository so no need to check login
if strings.Contains(resp.Request.URL.String(), "login") {
This is incorrect. The action's URL might contain
login
, like https://gitea.com/docker/login-actionI change it to be more explicitly. Hard to find perfect solution though.
@ -225,15 +223,11 @@ type remoteAction struct {
Ref string
}
func (ra *remoteAction) CloneURL(defaultURL string) string {
Maybe
@ -257,0 +254,4 @@
// TODO
// 1. gitea login page returns 200 so runner things that repository exists
// 2. use auth token to access private repository so no need to check login
if resp.Request.Response != nil && resp.Request.Response.StatusCode == http.StatusSeeOther {
I don't think it's right. The old logic is enough.
resp.Request.Response.StatusCode
andresp.StatusCode
?REQUIRE_SIGNIN_VIEW
. You could remove it fromactionURLs
in config if you don't need it.I think the bug is that the
resp.StatusCode
is 200 when the request is redirected to the login page. So one solution is to make thedetectActionClient
not follow the redirect.git allows for redirection so it would not be perfect either.
The flow is like bellow so I don't think this is a bug.
ok. I reverted it.
fix action cloning, set correct server_url for act_runner exeecto fix action cloning, set correct server_url for act_runner exec