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

push credentials on github actions #1050

Open
jdrouet opened this issue May 17, 2024 · 1 comment
Open

push credentials on github actions #1050

jdrouet opened this issue May 17, 2024 · 1 comment

Comments

@jdrouet
Copy link

jdrouet commented May 17, 2024

👋 Hey!
First, thank you for this wonderful project.
I'm writing here because I'm trying to write a git extension called git-metrics which would allow to store metrics regarding the project, inside git notes, with a simple CLI, so that we don't need to rely on external services.
I have some commands working (add, remove, show) but when it comes to push and pull, it becomes a bit more tricky considering it involves some authentication.
In this PR, I'm trying to use git-metrics push to push my notes, directly from a github action. Using git, we just need to do git push origin refs/notes/metrics and the authentication works out of the box.
With git2, the authentication doesn't seem to work.
Does anyone know, what is the proper way to authenticate using git2 on github actions?
Thank you

@Some1and2-XC
Copy link

Hey,

Its hard to make assumptions as you haven't given any error codes or anything that hasn't worked for you.
I would imagine however that using this section from the docs might help.

Using the RepoBuilder it seems as though you can make a Repository object which represents your repo.
Once you have your Repository object you can use this function to get the remote you want to push to.
From there you have a remote object which looks like it allows you to push & pull.

As for github actions, I'm not entirely sure how you would go about implementing calling those but I'm sure you can figure it out.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants