Diffinery

homeflare/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Test: build the fake GitHub App key at run time, so push protection doesn't flag it

diffinery.com's push protection refused the first copy of GitHub's main into
codician/diffinery: "Private key in blob ed8a9ef6a9", the fake PEM this test pastes
into GITHUB_APP_ID. The test still passes the same string; its source no longer
matches a private key pattern, so later versions of the file mirror without an
override.
altug authored 1 parent d993a8acommit 334de50d61f9a48026985f76c208593b31f1dd2fBrowse files
1 file changed+2−1
modifiedapps/diffinery/test/unit/deploy-github-app.test.ts+2−1View file
@@ -59,7 +59,8 @@
5959
6060 it("refuses a value of the wrong shape without printing it", () => {
6161 tree();
62- const pem = "-----BEGIN RSA PRIVATE KEY-----\nMIIEsecret\n-----END RSA PRIVATE KEY-----";
62+ // Put together at run time, so secret scanners (diffinery.com's push protection among them) don't take the fake key for a real one.
63+ const pem = ["BEGIN", "END"].map((edge) => `-----${edge} RSA PRIVATE KEY-----`).join("\nMIIEsecret\n");
6364 for (const [key, value, message] of [
6465 ["GITHUB_APP_ID", pem, "GITHUB_APP_ID must be the App ID, a number"],
6566 ["GITHUB_APP_SLUG", "Diffinery Runners", "GITHUB_APP_SLUG must be the slug"],