Skip to content

Publish from GitHub

Once more than one person changes the motions, keep the tenant repository on GitHub and let merges to main publish. Two pieces make that work: a workflow in the repository that checks every pull request and pushes main live, and the GitHub connection in the app, which turns edits made in the app into pull requests.

Add this file as .github/workflows/motions.yml. Pull requests run check, the TypeScript check and your tests. A merge to main runs them again and then pushes live.

.github/workflows/motions.yml
name: Motions
on:
pull_request:
push:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx motions check
- run: npm run typecheck
- run: npx motions test
push:
needs: check
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency: motions-push
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx motions push --live
env:
MOTIONS_URL: ${{ vars.MOTIONS_URL }}
MOTIONS_TOKEN: ${{ secrets.MOTIONS_TOKEN }}

Then, in the repository’s settings on GitHub, under Secrets and variables → Actions:

  1. Add a variable MOTIONS_URL, the address you open the app at.
  2. Create an API token in Motions (Settings → API tokens) with your own handle and the approver role. Add it as a secret named MOTIONS_TOKEN.

Each push records the commit it came from, so a version’s page shows the commit and whether main still has it.

Connecting lets people edit a motion in the app, safely: the edit becomes a pull request, and the workflow above publishes it when it’s merged.

  1. Open Settings → GitHub and choose to connect. Only owners and admins can.
  2. GitHub asks you to install the Motions GitHub App on your account or organization, and to authorize it. In an organization, an owner may have to approve the install first.
  3. Back in Motions, pick the repository, and the tenant folder: empty when the repository is the tenant, or a path such as clients/v360 when it holds more than one.
  4. Choose Connect. The page now shows the repository, the folder and the default branch.

If the page says “GitHub isn’t set up on this engine”, the platform hasn’t been configured for GitHub yet; ask Pruma.

An approver can change a motion’s steps and rules from a version’s Code tab without a terminal:

  1. Edit, then Save draft. This makes a new draft version, marked “not in git”.
  2. Open PR. The version’s page puts the changed files on a branch and opens a pull request on the connected repository.
  3. Merge it. The workflow pushes main live. The push contains the edit, so the draft becomes the live version, now marked “in git”.

motion.yaml can’t be edited in the app, only in the repository. A step can only be edited in the app if it imports nothing but its own motion’s files and the SDK.

Without a connected repository, you can still bring an app edit into your folder by hand:

Terminal window
npx motions pull <version> --motion weekly

pull writes the version’s files into motions/weekly/, and refuses to overwrite files with uncommitted changes unless you pass --force.

Motions is built by Pruma. These docs describe what the platform does today; Limitations lists what it doesn't do yet. Open the app