markdown · 1505 bytes Raw Blame History

Actions workflow API

Actions workflow lifecycle endpoints are PAT-authenticated and require repo:write. The token's user must also have write permission on the repository that owns the target run or job.

Runs Atom feed

GET /{owner}/{repo}/actions.atom

Returns the last 50 workflow runs as application/atom+xml. Visibility matches the Actions tab: public repositories are public; private repositories require repository read access.

Each entry links to the run page and summarizes workflow name, event, branch, commit, status, and conclusion.

Cancel job

POST /api/v1/jobs/{id}/cancel

Requests cancellation for a workflow job. Queued jobs become terminal immediately. Running jobs set cancel_requested=true; the runner observes that flag through its cancel-check endpoint, stops the active container, and reports the terminal status.

Response: 202 Accepted.

{
  "job_id": 10,
  "run_id": 4,
  "repo_id": 2,
  "changed_jobs": 1,
  "run_completed": false,
  "run_conclusion": ""
}

Re-run workflow run

POST /api/v1/runs/{id}/rerun

Creates a new workflow run from the original run's commit and workflow file. Only terminal runs are rerunnable. The new run records parent_run_id so the history remains linked.

Response: 201 Created.

{
  "run_id": 12,
  "run_index": 8,
  "parent_run_id": 4,
  "repo_id": 2,
  "workflow_file": ".shithub/workflows/ci.yml",
  "head_sha": "0123456789abcdef0123456789abcdef01234567"
}
View source
1 # Actions workflow API
2
3 Actions workflow lifecycle endpoints are PAT-authenticated and require
4 `repo:write`. The token's user must also have write permission on the
5 repository that owns the target run or job.
6
7 ## Runs Atom feed
8
9 ```text
10 GET /{owner}/{repo}/actions.atom
11 ```
12
13 Returns the last 50 workflow runs as `application/atom+xml`. Visibility
14 matches the Actions tab: public repositories are public; private
15 repositories require repository read access.
16
17 Each entry links to the run page and summarizes workflow name, event,
18 branch, commit, status, and conclusion.
19
20 ## Cancel job
21
22 ```text
23 POST /api/v1/jobs/{id}/cancel
24 ```
25
26 Requests cancellation for a workflow job. Queued jobs become terminal
27 immediately. Running jobs set `cancel_requested=true`; the runner observes
28 that flag through its cancel-check endpoint, stops the active container, and
29 reports the terminal status.
30
31 Response: `202 Accepted`.
32
33 ```json
34 {
35 "job_id": 10,
36 "run_id": 4,
37 "repo_id": 2,
38 "changed_jobs": 1,
39 "run_completed": false,
40 "run_conclusion": ""
41 }
42 ```
43
44 ## Re-run workflow run
45
46 ```text
47 POST /api/v1/runs/{id}/rerun
48 ```
49
50 Creates a new workflow run from the original run's commit and workflow file.
51 Only terminal runs are rerunnable. The new run records `parent_run_id` so the
52 history remains linked.
53
54 Response: `201 Created`.
55
56 ```json
57 {
58 "run_id": 12,
59 "run_index": 8,
60 "parent_run_id": 4,
61 "repo_id": 2,
62 "workflow_file": ".shithub/workflows/ci.yml",
63 "head_sha": "0123456789abcdef0123456789abcdef01234567"
64 }
65 ```