GitHub Action
Token pull requests from your own workflow.
arcarolabs/basemode-action runs the engine in your own GitHub workflow and opens or updates one pull request. It needs no code changes and no GitHub app. The Action is open source.
# .github/workflows/tokens.yml
on:
schedule: [{ cron: "0 22 * * 0-4" }]
workflow_dispatch:
permissions: { contents: write, pull-requests: write }
jobs:
tokens:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arcarolabs/basemode-action@v1
with:
basemode-key: ${{ secrets.BASEMODE_KEY }} # or figma-token + figma-file-keys on Enterprise
formats: tailwind4,typescript
path: src/tokens
Where tokens come from
basemode-key: the latest tokens published to your Basemode design system, from the plugin on any Figma plan.figma-tokenandfigma-file-keys: straight from Figma's API, which needs Figma Enterprise for variables.
What it does
The Action generates the files, compares them with the branch, and only opens a pull request when something changed. An unchanged run leaves the repository alone, so a pull request someone closed on purpose doesn't come back.
See the repository's README for every input.
Fail CI on drift
To stop a pull request that edits generated files by hand, add a check with the CLI:
- run: uvx --from basemode-tokens basemode pull --format tailwind4 --out src/tokens --check
env: { BASEMODE_KEY: "${{ secrets.BASEMODE_KEY }}" }