serverless-plugin-git-variables icon indicating copy to clipboard operation
serverless-plugin-git-variables copied to clipboard

Use a more generic way to pull repo name

Open efimk-lu opened this issue 3 years ago • 6 comments

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

efimk-lu avatar Sep 23 '21 18:09 efimk-lu

Running git config --get remote.origin.url will return for example [email protected]:lumigo-io/python_tracer.git

efimk-lu avatar Sep 23 '21 19:09 efimk-lu

Hey @jverce, how can I merge the PR?

efimk-lu avatar Oct 10 '21 18:10 efimk-lu

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: image

jverce avatar Jan 04 '22 21:01 jverce

Hey @jverce, not yet.

efimk-lu avatar Jan 05 '22 09:01 efimk-lu

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 avatar Jan 05 '22 16:01 jacob-meacham

@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

f00f avatar Apr 26 '22 21:04 f00f