fix: Use correct clone URL with new-actions-cache

new-actions-cache was not handling short action names relying on
DEFAULT_ACTIONS_URL: it would try to fetch from the short name
(actions/checkout) as if it was the full URL. This commit fixes that.

Upstream nektos/act has deprecated legacy actions cache in favor of a new
implementation which is more performant and does not suffer from data
races:
  https://github.com/nektos/act/issues/2419#issuecomment-2282814122

This change is required to use new-actions-cache in Forgejo Runner.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
Vitaliy Potyarkin 2024-12-28 12:35:08 +03:00
parent 1dc0d695a1
commit c024ab3079

View file

@ -70,7 +70,7 @@ func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
var err error
sar.cacheDir = fmt.Sprintf("%s/%s", sar.remoteAction.Org, sar.remoteAction.Repo)
repoURL := sar.remoteAction.URL + "/" + sar.cacheDir
repoURL := sar.remoteAction.CloneURL(sar.RunContext.Config.DefaultActionInstance)
repoRef := sar.remoteAction.Ref
sar.resolvedSha, err = cache.Fetch(ctx, sar.cacheDir, repoURL, repoRef, github.Token)
if err != nil {