Findings
Triggering CI: GitHub Actions, GitLab Pipelines, Bitbucket Pipelines
Added trigger/poll/rerun/cancel tools across the three git providers. Per-provider quirks worth noting:
GitHub Actions#
- Trigger:
POST /repos/{o}/{r}/actions/workflows/{workflow}/dispatches,{ref, inputs}.workflowis the file name (ci.yml) or numeric id.- The workflow file MUST declare
on: workflow_dispatch— otherwise 422. - Returns 204 No Content with no body → no run id. Caller must poll
github_list_workflow_runs(filterevent=workflow_dispatch/ branch) to find the created run, thengithub_get_workflow_run.
- The workflow file MUST declare
- Rerun:
runs/{id}/rerun(all) orruns/{id}/rerun-failed-jobs; success = 201. - Cancel:
runs/{id}/cancel; success = 202. - Scope:
repo(already granted) covers Actions write for OAuth — no manifest change.
GitLab Pipelines#
- Trigger:
POST /projects/:id/pipeline,{ref, variables}.variablesis a[{key, value}]array, not an object — the tool maps the caller's{K: V}object into that shape.- Needs a
.gitlab-ci.ymlon that ref or 400.
- Retry:
pipelines/:id/retry· Cancel:pipelines/:id/cancel— both return the pipeline. - Scope:
api(already granted) covers it — no manifest change.
Bitbucket Pipelines#
- Trigger:
POST /repositories/{ws}/{repo}/pipelines/(note trailing slash), body{target: {ref_type:"branch", type:"pipeline_ref_target", ref_name}}. Custom pipeline → addtarget.selector = {type:"custom", pattern}.- Variables go at the body root (NOT under
target):variables: [{key, value, secured}]. The tool maps{KEY: value}+ asecuredname-list into that shape. - Requires Pipelines enabled on the repo.
- Variables go at the body root (NOT under
- Get:
pipelines/{uuid}· Stop:pipelines/{uuid}/stopPipeline(204). - State nests under
state.name/state.result.name/state.stage.name— slimmed to{state, result}. - Scope: needs
pipeline+pipeline:write— added to manifest, so existing Bitbucket connections must reconnect to pick them up.
Tests: packages/server/tests/ci-trigger.test.ts.