How dpgalliance/publicgoods-form-opens-pr works
Project type and purpose
• This is an event-driven integration tool (not a full-stack app) that connects a Google Form → Google Sheets → Google Apps Script pipeline to the GitHub REST API, automatically creating pull requests with JSON files built from form responses.
File structure
• Top-level files:
• code.gs → Google Apps Script entry point, installed as a spreadsheet trigger (“On form submit”)
• index.js → local Node.js version used for development/testing
• package.json / package-lock.json → NPM dependencies for index.js
• README.md, LICENSE, .gitignore
• No separate frontend or backend folders; the “front end” is hosted by Google Forms/Sheets, the “backend” is a serverless Apps Script function.
README insights
• Google Forms → spreadsheet responses
• Script Editor trigger runs function getHead()
• Four GitHub API steps: fetch master ref, create branch, commit JSON file, open PR
• Local dev mirrors Apps Script logic in index.js
Main components
a. User browser / Google Form (UI)
b. Google Sheets (response store)
c. Google Apps Script runtime (triggered function)
d. GitHub REST API (external service)
e. GitHub repository (DPGAlliance/publicgoods-candidates)
f. (Optional) Local Node.js environment for development/testing
Architectural patterns
• Event-driven pipeline (trigger → function chain)
• Serverless runtime (Apps Script)
• Callback/Promise cascade implementing API steps
• Local development shim (index.js) for easier debugging
Technologies and libraries
• Google Forms & Sheets (UI + data store)
• Google Apps Script (JavaScript on Google Cloud)
• Node.js (local dev)
• Axios/fetch or built-in UrlFetchApp for HTTP
• GitHub REST API v3