Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--local-repository wildcard ref support #2662

Open
Makeshift opened this issue Feb 11, 2025 · 2 comments
Open

--local-repository wildcard ref support #2662

Makeshift opened this issue Feb 11, 2025 · 2 comments
Labels
kind/feature-request New feature or request

Comments

@Makeshift
Copy link

Act version

0.2.74

Feature description

As @ChristopherHX mentioned in #2390, allowing --local-repository to globally override any refs would be awesome.

Similar to in that issue, I have a single repository full of many different actions, eg

ebx/actions/action-bash-debug
ebx/actions/action-upload-s3-artifact
ebx/actions/action-app-deployer

etc.

Having to look up the current version in use by a workflow and having to write a custom ebx/actions@v1.2.3=/path/to/ebx/actions arg is a little inconvenient.

It's still an incredibly useful feature though, so I definitely appreciate it!

@Makeshift Makeshift added the kind/feature-request New feature or request label Feb 11, 2025
@ChristopherHX
Copy link
Contributor

If you want to learn some golang and have this feature it's probably pretty simple to change this matching code here and open a PR

logger := common.Logger(ctx)
logger.Debugf("LocalRepositoryCache fetch %s with ref %s", url, ref)
if dest, ok := l.LocalRepositories[fmt.Sprintf("%s@%s", url, ref)]; ok {
logger.Infof("LocalRepositoryCache matched %s with ref %s to %s", url, ref, dest)
l.CacheDirCache[fmt.Sprintf("%s@%s", cacheDir, ref)] = dest
return ref, nil
}
if purl, err := goURL.Parse(url); err == nil {
if dest, ok := l.LocalRepositories[fmt.Sprintf("%s@%s", strings.TrimPrefix(purl.Path, "/"), ref)]; ok {
logger.Infof("LocalRepositoryCache matched %s with ref %s to %s", url, ref, dest)
l.CacheDirCache[fmt.Sprintf("%s@%s", cacheDir, ref)] = dest
return ref, nil
}
}

l.LocalRepositories

contains your cli arguments split by =

if dest, ok := l.LocalRepositories[fmt.Sprintf("%s@%s", url, ref)]; ok { is used to match currently duplicate such an if + body make this happen

I'm behind my plans here and not working on any feature requests right now

@Makeshift
Copy link
Author

Learning some Go sounds like a pretty fun weekend project, actualy. I'll see if I can give it a go, thank you for the pointers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants