A GitHub Action (and CLI) that syncs a Domo Code Engine package definition from its JSDoc and deploys a new version. Add it to any repo that holds a Code Engine package's source, and on push it regenerates the function manifest from the source's JSDoc, creates a new package version, and (by default) releases it.
It is the headless equivalent of the Domo Toolkit extension's "Generate Definition from JSDoc" feature, sharing the exact same parser via the domo-codeengine-manifest package, so CI and the extension produce identical definitions.
- Reads the package source file from your repo.
- Fetches the current package version from Domo as the diff baseline.
- Parses the source's JSDoc into a function manifest (same parser as the extension).
- If any JSDoc has a blocking error, fails the run.
- If nothing changed, exits cleanly (no new version).
- Otherwise creates a new version (regenerating the required
module.exportsblock) and, unlessrelease: false, releases it.
# .github/workflows/sync-code-engine.yaml
name: Sync Code Engine Package
# Pushes to main that touch the package source (or its config) sync the Code
# Engine definition in Domo from the JSDoc in main.js. instance, packageId, and
# release live in domo-codeengine.json so this workflow stays boilerplate.
on:
push:
branches: [main]
paths:
- 'main.js'
- 'domo-codeengine.json'
# Lets you re-run the sync from the Actions tab without pushing a commit.
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- id: sync
uses: brycewc/domo-codeengine-sync@v1
env:
DOMO_DEVELOPER_TOKEN: ${{ secrets.DOMO_DEVELOPER_TOKEN }}
- name: Summarize
if: always() && steps.sync.outputs.results != ''
env:
RESULTS: ${{ steps.sync.outputs.results }}
VERSIONS: ${{ steps.sync.outputs.versions }}
run: |
{
echo '### Domo Code Engine sync'
echo ''
if [ -n "$VERSIONS" ]; then
echo "Synced: \`$VERSIONS\`"
else
echo 'Nothing to sync, the definition already matches the JSDoc.'
fi
echo ''
echo '```json'
echo "$RESULTS"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"The Summarize step is optional: it writes the sync result to the run's job summary. Drop it if you don't want one.
Provide a committed domo-codeengine.json (supports multiple packages):
{
"instance": "acme",
"packages": [{ "packageId": "…", "sourcePath": "main.js", "release": true }]
}Or use single-package inputs (instance, package-id, source-path, release) directly in the workflow. The config file wins when present; inputs are the fallback.
The developer token always comes from the DOMO_DEVELOPER_TOKEN secret/env, never the config file. Create one in Domo under Admin > Authentication > Access Tokens; it must permit Code Engine version create and release.
| Input | Description | Default |
|---|---|---|
instance |
Domo subdomain (acme) or full base URL. Optional if in config. |
|
developer-token |
Prefer the DOMO_DEVELOPER_TOKEN env from a secret over this. |
|
config-path |
Path to the config file. Defaults to ./domo-codeengine.json. |
|
package-id |
Package UUID (single-package mode). | |
source-path |
Path to the package source .js (single-package mode). |
|
release |
Release (deploy) after creating. Set false to stage unreleased. |
true |
| Output | Description |
|---|---|
versions |
Comma-separated packageId@version list of synced packages. Empty when nothing changed. |
results |
JSON array of per-package results. Also set to the partial results when the run fails. |
DOMO_DEVELOPER_TOKEN=… npx domo-codeengine-sync \
--instance acme --package-id <uuid> --source-path src/pkg.js
# or, with a config file in the cwd:
DOMO_DEVELOPER_TOKEN=… npx domo-codeengine-sync --config domo-codeengine.json
# stage without releasing:
DOMO_DEVELOPER_TOKEN=… npx domo-codeengine-sync --instance acme --package-id <uuid> --source-path src/pkg.js --no-releaseyarn # install (pulls domo-codeengine-manifest straight from its git tag)
yarn test # node --test
yarn build # bundle to dist/index.js with ncc (commit the result)A JS GitHub Action runs the committed dist/index.js, so run yarn build and commit dist/ whenever src/ changes. CI enforces this.
Note:
domo-codeengine-manifestis not on npm and does not need to be. It resolves straight from a tag in its own repo (brycewc/domo-codeengine-manifest#v0.1.0), andyarn.lockpins the exact commit that tag points at, so installs stay reproducible even if the tag moves. Bumping the parser means pointing at a newer tag, then runningyarn buildand committingdist/.