↑ ↓ navigate↵ selectesc close
✏️ Blog PostGitHubSecurityFirebaseDevOpsReactSvelteGit

Cloud Function GitHub Update

CodingCat.dev tutorial cover image

Authentication using Nodegit

nodegit Authentication has become the biggest prolem with this entire process! I have added a comment to Issue 1035 but I don't know if it will get much traction as it seems there have been several issues out there already.

Failed Attempts

All of these attempts of course work for cloning, because I do not think it really checks

  • sshKeyNew
return NodeGit.Cred.sshKeyNew('username', publicKeyContents, privateKeyContents, '').then(function (
	cred
) {
	assert.ok(cred instanceof NodeGit.Cred);
});
  • userpassPlaintextNew sh return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic");
### Successful Attempt - **sshKeyFromAgent** ```sh return nodegit.Cred.sshKeyFromAgent(userName);

Cloud Funcitons

So the above sshKeyFromAgent works great while I am on my local Dev box (MacOS 10.14) after running the command ssh-add. I am currently running Node v10.14.1.I thought that it would be easy enough to do the same on a cloud function, but this took some digging. I then found out that Node 6 base image is on Debian, I thought it was Alpine.Interestingly they changed this in Node 8 base image to running Ubuntu 18.04, so I will have to keep an eye on this if Upgrading.

As many great things in life, sometimes you dribble down a lane that is direct into a double team...so you must pivot to score. (Wow it must be late, basketball analogies are showing up!)

simple-git aka git-js

I ended up switching to simple-git as nodegit ssh issues had me 2 days behind on trying to get out lesson 8. It provides a very simple interface to effectively accomplish everything I needed. It also allows me to use a personal token to do Git updates to GitHub which I liked a lot better.

Resources, Links & Official Documentation

Related CodingCat.dev Tutorials & Podcast Episodes

Frequently Asked Questions (FAQ)

What are the main takeaways from Cloud Function GitHub Update?

Changing git libraries. Cloud Function GitHub Update explores practical patterns for GitHub, Security in modern software engineering. Throughout this post, Alex Patterson breaks down real-world implementation details for GitHub, Security so developers can apply these patterns directly in production.

How do you implement GitHub best practices in production?

When adopting GitHub and Security in a production stack, start by validating your configuration against the GitHub Documentation (Pull requests, GitHub Actions CI/CD, and repository security). Focus on incremental adoption, automated testing, and observability so your team can measure performance and developer velocity improvements at each stage.

Where can I watch the full Cloud Function GitHub Update walkthrough and find related code resources?

You can explore the complete write-up and code examples right here on CodingCat.dev, and subscribe to the CodingCat.dev YouTube channel for weekly video tutorials. For a deeper dive into GitHub, check out our related guide: RxFire in Svelte 3 using Firebase Firestore and Authentication.

✏️ Visual Architecture Diagram

how this post connects together.

Follow AJ from first principles to production-ready architecture.

✏️ Visual Diagram: Cloud Function GitHub Update
✓ Good PatternVISUAL DIAGRAM
Visual Diagram: Cloud Function GitHub UpdateVisual architectural diagram showing: Step 1: Cloud Function GitHub (Mental model & why it matters) -> Step 2: Hands-On Implementation (Under the hood & live code) -> Step 3: Ship It Purrfectly (✓ Production trade-offs). Step-by-step diagram breakdown for Cloud Function GitHub Update: start with Cloud Function GitHub , implement Hands-On Implementation, and ship to production.✓Step 01Cloud Function GitHub Mental model & why it matters✓Step 02Hands-On ImplementationUnder the hood & live code✓Step 03Ship It Purrfectly✓ Production trade-offsunroll the yarn✓ production ready
[Diagram Walkthrough]Step-by-step diagram breakdown for Cloud Function GitHub Update: start with Cloud Function GitHub , implement Hands-On Implementation, and ship to production.
AAA Contrast Verified
▶ Watch on @CodingCatDev YouTubeRelated Course & Video

Watch the Related Video Deep Dive: The Odin Project 2: Git & GitHub Engineering Workflows

Understand how Git actually stores snapshots, master branching and interactive rebase, write atomic commits, and automate PR checks with GitHub Actions.

View Full Page →