Logging into Git as a GitHub App #24664
-
How would I log into Git as a GitHub App? 🤔 I’ve sort of got it working, but I’m curious what the “actual” way of doing this is 😃 What would I set as the Git username and email? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 10 replies
-
👋 @cjdenio –– great questions! Thank you for raising them here 🙇♂️
It’s possible to authenticate with github.com as a GitHub App; here’s the section on HTTP-based Git access by an installation.
That’s a great question! The way we currently attribute commits made by GitHub Apps isn’t currently publicly documented in our You could set the Git username is the name of your application with
For the email, you could set it to the GitHub App’s user
Here’s an example commit showing the GitHub Actions installation committing to a repository: In its patch file, observe the second line’s contents:
One approach for obtaining the GitHub App’s user ID is to create a new file using the Contents API, navigating to the commit on github.com, and appending |
Beta Was this translation helpful? Give feedback.
-
Wow, this is is awesome! 🤯 Thanks for taking the time to answer; I really appreciate having closure on this question 😃 |
Beta Was this translation helpful? Give feedback.
-
@francisfuzz Is there a way to authenticate with Github over SSH as a Github App - maybe somehow using Github App private key? |
Beta Was this translation helpful? Give feedback.
-
👋 @inez: Great question! There’s no way for a GitHub App to authenticate using an SSH key at this time. |
Beta Was this translation helpful? Give feedback.
-
I was so happy to read this entry, thank you for sharing it @francisfuzz. I’d like to mention that you could get the user id from the Content API response, same endpoint you referenced: create new file. |
Beta Was this translation helpful? Give feedback.
-
@francisfuzz thanks a lot for this information! I have one more question, how did you make the bot has the verified signature in this updated: 1591652451925 · actions-packages-examples/github-script__playground@f75a13b · GitHub, I am trying to do similar things, authenticate the github app in the github actions, and make a new commit, but I couldn’t make the bot’s signature to be verified. |
Beta Was this translation helpful? Give feedback.
-
@hsy3418 - For that particular instance, I left a comment here: github.com/actions-packages-examples/github-script__playgroundupdated: 1591652451925
|
Beta Was this translation helpful? Give feedback.
-
Hi @francisfuzz, the link for bot signature verification doesn’t work anymore. Can you please share a new one or explain how to get verified signatures when using a GitHub app token to push commits in a workflow? |
Beta Was this translation helpful? Give feedback.
-
A much simpler approach to getting your app's "User ID" is to simply call: https://api.github.com/users/myapp[bot] Replacing |
Beta Was this translation helpful? Give feedback.
-
Hello, Thank you for explanation. We was able to push commit with GitHub App from our Jenkins.
|
Beta Was this translation helpful? Give feedback.
👋 @cjdenio –– great questions! Thank you for raising them here 🙇♂️
It’s possible to authenticate with github.com as a GitHub App; here’s the section on HTTP-based Git access by an installation.
That’s a great question! The way we currently attribute commits made by GitHub Apps isn’t currently publicly documented in our
Setting your commit email address
article and is subject to change at anytime without notice. If it’s helpful in the meantime, here’s something you could try (though your mileage may…