Metadata-Version: 2.5
Name: badgerp_ci
Version: 0.1.0
Summary: Latest public GitHub Actions and GitLab pipeline status
Project-URL: Documentation, https://philocalyst.tngl.io/Badger/plugins.html
Project-URL: Repository, https://tangled.org/largo.tngl.sh/plugin-ci
Project-URL: Issues, https://tangled.org/largo.tngl.sh/plugin-ci/issues
Author: Philocalyst
License-Expression: BlueOak-1.0.0
License-File: LICENSE.md
Keywords: badge,badge-plugin,badger
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# badgerp_ci

The latest public GitHub Actions run, GitLab.com pipeline, or AppVeyor build, not the latest
successful run. Uses the shared bounded JSON transport without dependencies,
authentication, custom hosts, or service writes.

```python
ci(repository="rust-lang/rust", workflow="ci.yml", branch="main")
ci(repository="inkscape/inkscape", provider="gitlab", branch="master")
```

`run(repository, provider="github", workflow="", branch="")`

GitHub `workflow` may be a filename or numeric ID as a string. Omitting it selects
the latest run across all workflows. Omitting `branch` selects across all branches,
not necessarily the default branch. GitLab accepts nested group/project paths,
uses `branch` as its ref filter, and rejects a nonempty `workflow` argument. It
requests pipelines ordered by descending ID, one result, to avoid treating an
empty pipeline list as a permissions failure.

- Success is green; failure/timeouts are red.
- Running, queued, pending, waiting, manual, and scheduled states are amber.
- Canceled, skipped, neutral, stale, and unfamiliar states remain gray.
- Empty lists are `no runs`; missing status or completed-run conclusion is
  `unknown`, never passing. Unrecognized status text is preserved.
- Network, rate-limit, and malformed-schema errors propagate.

Only these three hosted CI services are supported. There are no private-token,
coverage, historical trend, self-hosted, or Tangled pipeline claims. CI rendering
creates static badges; no live polling, persistent cache, or automatic retry is
performed. Public GitHub requests share its unauthenticated per-IP rate budget.

## API references

- https://docs.github.com/en/rest/actions/workflow-runs
- https://docs.gitlab.com/api/pipelines/

Tests inject deterministic API payloads and verify active/completed/unknown
states, escaping, filters, empty results, and errors. They do not establish live
service availability.

## AppVeyor

Use `provider="appveyor"` and `repository="account/project-slug"`, which is the
AppVeyor project identity, not necessarily the upstream GitHub repository path.
The public latest-build endpoint is used; `branch` optionally selects its latest
branch build. `workflow` is rejected. Queued/running remain amber, failed red,
cancelled neutral, success green. An explicit null build or missing build status
is unknown; a missing build field or malformed payload raises an error. There
are no project settings, environment variables, or logs fetched, and no tokens.

- https://www.appveyor.com/docs/api/projects-builds/
- https://www.appveyor.com/docs/api/samples/download-artifacts-sh/

The current curl project response was verified publicly without authentication;
the old official example project returned404 and was not treated as a pass.
