Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
refresh-cw

GitHub Action

Glitch Project Sync

v1.1

Glitch Project Sync

refresh-cw

Glitch Project Sync

Sync the contents of your GitHub repository with your project on Glitch

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Glitch Project Sync

uses: kanadgupta/glitch-sync@v1.1

Learn more about this action in kanadgupta/glitch-sync

Choose a version

Glitch Sync From GitHub

Remix on Glitch

This action uses the Glitch API to export your GitHub repository to your Glitch project.

Requirements

  • A public GitHub repository
  • An existing Glitch project

Inputs

project-id

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/

auth-token

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.

path

Optional A relative path to a specific folder to import. If not passed, it will just import the entirety of the GitHub repository.

Example usage

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

Disclaimer

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.