{"id":51100753,"url":"https://github.com/primitivedotdev/deploy-function","last_synced_at":"2026-06-24T10:30:34.154Z","repository":{"id":361952821,"uuid":"1256360172","full_name":"primitivedotdev/deploy-function","owner":"primitivedotdev","description":"GitHub Action for deploying a Primitive Function — primitive.dev","archived":false,"fork":false,"pushed_at":"2026-06-05T18:46:58.000Z","size":654,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T11:33:54.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://primitive.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primitivedotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-01T17:48:55.000Z","updated_at":"2026-06-07T06:54:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/primitivedotdev/deploy-function","commit_stats":null,"previous_names":["primitivedotdev/deploy-function"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/primitivedotdev/deploy-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivedotdev%2Fdeploy-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivedotdev%2Fdeploy-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivedotdev%2Fdeploy-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivedotdev%2Fdeploy-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primitivedotdev","download_url":"https://codeload.github.com/primitivedotdev/deploy-function/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivedotdev%2Fdeploy-function/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34726585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-24T10:30:33.428Z","updated_at":"2026-06-24T10:30:34.149Z","avatar_url":"https://github.com/primitivedotdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy Primitive Function\n\nGitHub Action that deploys a [Primitive Function](https://primitive.dev) to primitive.dev. Idempotent — creates the function on first run, updates it on subsequent runs. Manages custom `function_secrets` in lockstep with the deploy and triggers a re-bind when bindings change.\n\n## Quick start\n\n```yaml\n- uses: actions/checkout@v4\n- run: pnpm install --frozen-lockfile \u0026\u0026 pnpm build\n- uses: primitivedotdev/deploy-function@v0\n  with:\n    api-key: ${{ secrets.PRIMITIVE_API_KEY }}\n    name: my-function\n    code-path: dist/handler.js\n    source-map-path: dist/handler.js.map\n```\n\n## Inputs\n\n| Input | Required | Default | Description |\n|---|---|---|---|\n| `api-key` | yes | — | Org-scoped Primitive API key. Pass via `${{ secrets.* }}` — masked in logs. |\n| `api-base-url` | no | `https://api.primitive.dev/v1` | API base URL. Override only if deploying against a non-production environment. |\n| `name` | yes | — | Function name. `/^[a-z0-9_-]{1,64}$/`. Idempotent within the org. |\n| `code-path` | one of | — | Path to a pre-built ESM bundle (e.g. `dist/handler.js`). Mutually exclusive with `files-path`. |\n| `source-map-path` | no | — | Source map for the `code-path` bundle. Surfaces readable stack traces in the dashboard. |\n| `files-path` | one of | — | Path to a source directory for **managed build**. The Action walks the tree, applies ignore patterns, and the platform builds server-side. Directory must contain a `package.json` at its root. Requires the `functions_managed_build` entitlement on the org. Mutually exclusive with `code-path`. |\n| `ignore` | no | — | Newline-delimited basename patterns to skip when walking `files-path`. Layered on top of the [default ignore list](#default-ignore-list). |\n| `secrets` | no | `{}` | JSON object of custom function secrets to upsert. Values are masked. |\n| `redeploy-on-secret-change` | no | `true` | Re-bind the runtime after upserting secrets. |\n| `expected-org-id` | no | — | Safety guard: aborts if the API key's org differs from this UUID. Strongly recommended in production workflows. |\n\nExactly one of `code-path` and `files-path` must be set.\n\n### Default ignore list\n\n`node_modules`, `.git`, `.github`, `dist`, `build`, `.next`, `.turbo`, `.vercel`, `coverage`, `.DS_Store`, `.env`, `.env.local`, `.env.*` (covers `.env.production`, `.env.staging`, etc).\n\nAdd to it via the `ignore` input — basenames anywhere in the tree, exact match or simple glob (`*.log`, `*.test.ts`). `#` comments and blank lines allowed.\n\n## Outputs\n\n| Output | Description |\n|---|---|\n| `function-id` | UUID of the created or updated function. |\n| `deploy-status` | `deployed`, `pending`, or `failed`. |\n| `created` | `true` on initial create, `false` on update. |\n\n## Examples\n\n### Minimal — pre-built bundle\n\n```yaml\n- uses: primitivedotdev/deploy-function@v0\n  with:\n    api-key: ${{ secrets.PRIMITIVE_API_KEY }}\n    name: my-function\n    code-path: dist/handler.js\n```\n\n### With custom secrets and an org-id guard\n\n```yaml\n- uses: primitivedotdev/deploy-function@v0\n  with:\n    api-key: ${{ secrets.PRIMITIVE_API_KEY }}\n    expected-org-id: ${{ vars.PRIMITIVE_ORG_ID }}\n    name: my-function\n    code-path: dist/handler.js\n    secrets: |\n      {\n        \"OPENAI_API_KEY\": \"${{ secrets.OPENAI_API_KEY }}\",\n        \"FEATURE_FLAG\": \"on\"\n      }\n```\n\nThe action upserts each secret via `POST /v1/functions/{id}/secrets`, then calls `POST /v1/functions/{id}/redeploy` so the new bindings are live in the runtime. Set `redeploy-on-secret-change: false` to skip the redeploy step (only the secret rows are touched).\n\n### Managed build (`files-path`)\n\nSkip the build step and hand the platform your source. The platform bundles server-side, applying the same Workers-for-Platforms compatibility flags as the dashboard's managed-build path.\n\n```yaml\n- uses: actions/checkout@v4\n- uses: primitivedotdev/deploy-function@v0\n  with:\n    api-key: ${{ secrets.PRIMITIVE_API_KEY }}\n    name: my-function\n    files-path: ./function-source\n    ignore: |\n      # local-only assets the platform doesn't need\n      fixtures\n      *.test.ts\n      *.spec.ts\n```\n\n`function-source/` must contain a `package.json` at its root (dependencies may be empty).\n\n### Using outputs\n\n```yaml\n- id: deploy\n  uses: primitivedotdev/deploy-function@v0\n  with:\n    api-key: ${{ secrets.PRIMITIVE_API_KEY }}\n    name: my-function\n    code-path: dist/handler.js\n- run: echo \"Deployed function-id=${{ steps.deploy.outputs.function-id }} (created=${{ steps.deploy.outputs.created }})\"\n```\n\n## Security\n\n- The `api-key` input is automatically masked. Pass it as a GitHub secret (`${{ secrets.* }}`) — never hard-code.\n- Every value passed via `secrets` is also masked.\n- Use `expected-org-id` in production workflows. It calls `GET /v1/whoami` before any write and aborts if the API key's org doesn't match.\n\n## Versioning\n\n- Floating major tag `v1` always tracks the latest 1.x.\n- Pin a specific minor/patch (`v1.2.0`) for reproducible deploys.\n- Breaking changes bump the major; `v1` stays alive for a deprecation window.\n\n## Source\n\nThis action is authored in [primitivedotdev/primitive-mono-repo](https://github.com/primitivedotdev/primitive-mono-repo) under `tools/actions/deploy-function/` and mirrored here on release tags. See [RELEASING.md](./RELEASING.md) for the release process.\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivedotdev%2Fdeploy-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimitivedotdev%2Fdeploy-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivedotdev%2Fdeploy-function/lists"}