GitHub Action
Glitch Project Sync
This action uses the Glitch API to export your GitHub repository to your Glitch project.
- A public GitHub repository
- An existing Glitch project
Required The ID of your Glitch Project. You can easily obtain this by logging process.env.PROJECT_ID
in your Glitch project. More info: https://glitch.com/help/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 below). 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 request to https://api.glitch.com/project/githubImport is made.
Optional A relative path to a specific folder to import. If not passed, it will just import the entirety of the GitHub repository.
See .github/workflows/main.yml
for a full example.
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@master
with:
project-id: '${{ secrets.projectId }}'
auth-token: '${{ secrets.authToken }}'
path: '${{ secrets.path }}' # optional
I am not an employee of Glitch (just an enthusiastic 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.