Docs
Search docs

List a repository's workflow definitions

GET/api/repos/{owner}/{repo}/workflows

listRepositoryWorkflows

Authentication optional — this operation also accepts anonymous requests. When authenticating, use a bearer token or a session cookie.

curl

curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/workflows' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

fetch("https://neosource.dev/api/repos/OWNER/REPO/workflows", {
  method: "GET",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
  },
});

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

Responses

200Workflows

application/json

WorkflowListResponse

object

ci_workflow_source

CiWorkflowSource

string

Which workflow directories a repository runs (`repos.ci_workflow_source`, ADR 0159). A per-repo setting changed by a repo admin through `PATCH /api/repos/{owner}/{repo}/settings`. Two values on purpose — there is no "GitHub only": `.neosource/workflows/` always runs, so a repo that opts in runs both directories, exactly as GitHub would run both sets if it read them.

"neosource""neosource_and_github"

discovered

array

Inactive GitHub Actions files found in `.github/workflows/`: every one while the repo runs only `.neosource/workflows/`, and the ones a same-named native file shadows when it runs both. Usually empty; non-empty means the repo has CI we deliberately do not run.

items

DiscoveredWorkflowResponse

object

A workflow file found in `.github/workflows/` — parsed and reported, but **not registered and never run** (ADR 0073: discover loudly, activate explicitly). neosource runs workflows from `.neosource/workflows/`. An imported GitHub repo whose CI lives in `.github/workflows/` would otherwise get a blank Actions tab with no explanation; these entries are that explanation, and they double as a pre-flight check — the diagnostics are produced by the same parser that would run the file if it were activated.

namerequired

string

The workflow's declared `name:`, for display. Falls back to the file name when the file could not be parsed.

parsedrequired

boolean

`false` when the file failed to parse entirely — the single `severity: "error"` entry in `warnings` says why. `true` with a non-empty `warnings` means it parsed, but parts of it were ignored. "Would run as-is if activated" is `parsed && warnings.is_empty()`.

pathrequired

string

Repo-relative path, e.g. `.github/workflows/ci.yml`.

warningsrequired

array

The diagnostics this file would produce if it were activated — unsupported keys (`container:`), unsupported triggers, and so on.

workflowsrequired

array

Registered, dispatchable workflows: `.neosource/workflows/`, plus `.github/workflows/` when `ci_workflow_source` is `neosource_and_github`.

items

WorkflowResponse

object

check_contexts

array

Available canonical check contexts for this workflow's jobs. Matrix jobs expose their base aggregate context, not individual legs. These names do not promise that the workflow runs on any particular commit.

items

string

created_atrequired

integerint64

dispatch
idrequired

string

namerequired

string

The `name:` declared in the workflow YAML, for display. A file that failed to parse is named after itself (e.g. `broken.yml`), so this is always something showable. This, `dispatch`, and `check_contexts` are the only projections of the parsed definition on the wire. The full `WorkflowDef` used to be returned here and reached ~100 KB per request on a real repo while every client read just the name; the runner gets definitions through the job-claim path, not this listing.

pathrequired

string

repo_idrequired

string

source_operationrequired

string

updated_atrequired

integerint64

warningsrequired

array

Parse diagnostics recorded when the file was indexed: unknown GHA keys / unsupported triggers ignored with `severity: "warning"`, or a whole-file parse failure as `severity: "error"` (such a workflow is stored inert — no triggers, no jobs — and never runs). Empty when the file parsed clean.

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 403Forbidden — one of: forbidden
  • 404Not Found — one of: not_found
  • 423Locked — one of: busy
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget

Schemas

Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.

WorkflowWarning

object

A non-fatal diagnostic collected while parsing workflow YAML. GHA's own forward-compat posture: a valid-but-unmodeled key (`permissions:`, `concurrency:`, `defaults:`, …) must not fail the whole file — it is ignored and reported. Persisted alongside the indexed workflow (`workflows.warnings`) so the API/UI can surface "this workflow has warnings / failed to parse" instead of the file silently ceasing to exist.

locationrequired

string

Where in the document: `workflow`, `on.push`, `job 'build'`, `job 'build' step 2 ('Deploy')`, …

messagerequired

string

severityrequired

WorkflowWarningSeverity

string

Severity of a [`WorkflowWarning`].

"warning""error"

WorkflowDispatchResponse

object

A workflow's `on: workflow_dispatch` declaration, as the "Run workflow" form needs it.

inputsrequired

array

Declared inputs, alphabetical by name (the stored definition does not preserve YAML order, so no client should expect it). Empty for a bare `on: workflow_dispatch`.

items

WorkflowDispatchInputResponse

object

One declared `workflow_dispatch` input. Mirrors `neosource_core::model::WorkflowDispatchInput` plus its name.

default

string | null

The YAML `default:`, always a string; the server coerces it to the declared type when the input is not submitted.

description

string | null

namerequired

string

The key under `inputs:` — what the dispatch body and `${{ inputs.<name> }}` refer to it by.

options

array

The `options:` of a `choice` input; empty otherwise.

items

string

required

boolean

typerequired

WorkflowDispatchInputType

string

The declared `type:` of a `workflow_dispatch` input — GitHub's closed set. It decides how a submitted value is coerced ([`resolve_dispatch_inputs`]) and which form control the SPA renders. `Environment` behaves exactly as `String` everywhere — neosource has no deployment environments — and is modelled only so the YAML parses without a warning and the form can label it. The serde `snake_case` strings are the wire vocabulary (pinned by the `enum_wire_consistency` tests).

"string""choice""boolean""number""environment"