serverless-plugin-git-variables
serverless-plugin-git-variables copied to clipboard
Use a more generic way to pull repo name
Extracting the repo name from the folder into which the git repo was cloned is dangerous. Mainly because the folder name can change. This is a more robust way of pulling it.
See https://stackoverflow.com/a/42543006
Running git config --get remote.origin.url
will return for example [email protected]:lumigo-io/python_tracer.git
Hey @jverce, how can I merge the PR?
Any updates on this one?
This is especially needed when running on CI/CD pipelines like CircleCI where they clone the repo onto a generically named folder called project
and we end up with something like this:
Hey @jverce, not yet.
Apologies, this fell off my radar! @efimk-lu would you mind adding a legacy escape for people relying on the old behavior, along with config to explicitly set the remote (defaulting to the first in the list is fine, but nice to let users specify a remote). Once that's done I'll merge and release
@jacob-meacham Using the folder name is annoying. Would this be the config logic you want? I might take the time to implement it. Can someone hint me at docs on how to define config parameters?
(parameter names below are just for illustration purposes. feel free to suggest good names)
If remote
is configured, use that
Else, if use_first_remote
is configured to true
, use first remote
Else: old behaviour