Note
On July 8th, 2025, Glitch ended project hosting, which means this project is now sunset. Glitch was run by a great group of people โ the product and team inspired a lot of little projects that I'm very proud of (including this one).
Much gratitude to the Glitch team for all the great work they did (including, but not limited to, not taking down the endpoint that this tool relied on).
Au revoir, Glitch!
This action uses the Glitch API to export your GitHub repository to your Glitch project.
- A GitHub repository
- An existing Glitch project
Required The Authorization request header used when clicking the Import from GitHub button (Tools > Import and Export > Import from GitHub) from within your Glitch project (see screenshot to the right). The only way that I know to obtain this is to look at your Network tab in your browser and capture the contents of the Authorization request header when the POST request to https://api.glitch.com/project/githubImport is made.
Important
Glitch rotates this token regularly so you'll need to ensure it stays updated in order for this tool to work properly. In my testing, the token rotates roughly once a month.
Required The ID of your Glitch Project. You can obtain this via one of two ways:
- Grabbing the value the
projectIdquery parameter of the aforementionedPOSTrequest to https://api.glitch.com/project/githubImport - Logging
process.env.PROJECT_IDin your Glitch project. More info: https://glitch.happyfox.com/kb/article/30-variables/
Optional A relative path to a specific folder to import. If not passed, it will import the entirety of the GitHub repository.
Optional The GitHub repository to sync, using the format owner/repo (e.g., octocat/Hello-World). If not passed, the current GitHub repository will be synced.
See .github/workflows/ci.yml for several full examples.
I strongly recommend adding the inputs as encrypted secrets instead of passing them directly into your action file! Here are the GitHub docs on how to do this.
uses: kanadgupta/glitch-sync@main
with:
auth-token: '${{ secrets.authToken }}'
project-id: '${{ secrets.projectId }}'
path: 'dist' # optionalI am not an employee of Glitch (merely a user)! This repository is not endorsed by Glitch and does not use a documented public API endpoint (and the endpoint can be kind of flaky to be honest). The endpoint may change at anytime and break this workflow.
