Skip to content

Run protection

The workflows a workspace's owners added to its repositories, g1t's required workflows: each runs in every repository it targets as that repository's own workflow (its token, its secrets, its checks), under the path managed/<name>.yml, from a copy of its source file taken when it was saved.

GET/workspaces/{workspace}/actions/managed-workflows

Each has name, path, workflow_name (its name:), source (owner/repo/path@ref), source_sha (the commit it was copied at), source_private, mode, repositories, visibility, content (the copy that runs) and when and by whom it was last saved. Owners only.

  • Authentication: Required. Send an access token as Authorization: Bearer.
  • MCP tool: workflow with action list_managed_workflows, and the same inputs
  • Scope: An access token needs workspace:read.
Name Type Required Description
workspace string Yes The workspace’s name, e.g. “acme”.
curl https://api.g1t.sh/workspaces/flagon-io/actions/managed-workflows \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"total_count": 1,
"managed_workflows": [
{
"name": "security-scan",
"path": "managed/security-scan.yml",
"workflow_name": "Security scan",
"source": "flagon-io/policies/.g1t/workflows/security-scan.yml@main",
"source_sha": "4f1c2a9e0b7d3c5a8e6f1b2d4c7a9e0f3b5d8c1a",
"source_private": false,
"mode": "required",
"repositories": [
"*",
"!sandbox-*"
],
"visibility": "all",
"content": "name: Security scan\non: [push, pull_request]\njobs:\n scan:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - run: ./scripts/scan.sh\n",
"created_at": "2026-10-12T09:30:00Z",
"updated_at": "2026-10-12T09:30:00Z",
"updated_by": "ada"
}
]
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
422 invalid The input is not valid. message says which field and why.