Skip to main content

Module api

Module api 

Source
Expand description

Saved GitHub Actions API responses.

--runs DIR reads runs-*.json (a GET /repos/{owner}/{repo}/actions/runs body) and jobs-<run_id>*.json (a GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs?filter=all body). Several files are pages of one list. Only files directly in the directory are read. Bodies from attempts/{n}/jobs are a different list and are not mixed in.

repo.json in that directory is the GET /repos/{owner}/{repo} body. private: false marks the repository public. A missing file, or a missing private field, leaves the repository billed at list price.

A run path is stored so it matches a CSV workflow_path: the @ref suffix (including @refs/heads/...) and an owner/repo/ prefix are removed. head_branch and pull_requests[].number are kept when present so two runs of one workflow can be compared on the same branch or pull request.

Structs§

ApiData
Runs and jobs loaded from one directory.
ApiError
The runs directory or one JSON file could not be read. Exit code 2.
Job
One job from jobs[].
WorkflowRun
One workflow run from workflow_runs[].

Constants§

IN_PROGRESS
Phrase used when a job has not finished.
UNKNOWN_WORKFLOW
Workflow path used when a job has no matching run record.

Functions§

linked_workflow_path
Drop @ref and an owner/repo/ prefix so a run path matches a CSV workflow path.
parse_jobs
Parse one jobs page body, the same way read_dir parses each jobs-*.json file.
parse_runs
Parse one workflow_runs page body, the same way read_dir parses each runs-*.json file.
read_dir
Read every runs page and jobs?filter=all page in dir.
repository_from_run_path
owner/repo from a raw Actions run path, before @ref and the workflow prefix are removed.
workflow_paths_match
Both paths refer to the same workflow file after linking.