Merge pull request #18 from codician-team/claude/fake-key-from-parts
Test: build the fake GitHub App key at run time, so push protection doesn't flag it
altugank authored · GitHub committed 2 parents d993a8a334de50commit 13fca51c2747708f7a9c3fc48607dd77fd1de66eBrowse files
1 file changed+2−1
modifiedapps/diffinery/test/unit/deploy-github-app.test.ts+2−1View file
| @@ -59,7 +59,8 @@ | ||
| 59 | 59 | |
| 60 | 60 | it("refuses a value of the wrong shape without printing it", () => { |
| 61 | 61 | 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"); | |
| 63 | 64 | for (const [key, value, message] of [ |
| 64 | 65 | ["GITHUB_APP_ID", pem, "GITHUB_APP_ID must be the App ID, a number"], |
| 65 | 66 | ["GITHUB_APP_SLUG", "Diffinery Runners", "GITHUB_APP_SLUG must be the slug"], |