Run TrustCheck in GitHub Actions to evaluate the trust posture of a PyPI package before it is installed, promoted, or approved.
This action is a lightweight wrapper around the core trustcheck CLI. It installs the CLI and runs trustcheck inspect inside your workflow so you can surface provenance, publisher, repository, vulnerability, and policy-related signals during CI.
Traditional dependency checks usually answer "is this package known to be vulnerable?"
TrustCheck helps answer earlier questions, such as:
- does this release have verified provenance?
- do attested publisher details point to the expected repository and workflow?
- do declared repository URLs line up with attested evidence?
- are there vulnerability records or higher-risk trust signals that should block adoption?
The core CLI combines PyPI metadata, provenance availability, cryptographic attestation verification, Trusted Publisher identity hints, repository matching, release drift signals, and vulnerability records into a single report.
This action currently:
- installs
trustcheckfrom PyPI - runs
trustcheck inspect <package> - fails the workflow step if the CLI exits with a non-zero status
That makes it a simple way to bring TrustCheck into GitHub Actions today while keeping the heavy lifting in the core project.
name: TrustCheck Scan
on:
pull_request:
workflow_dispatch:
jobs:
trustcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Inspect package with TrustCheck
uses: Halfblood-Prince/trustcheck-action@v1
with:
package: requests| Name | Required | Description |
|---|---|---|
package |
Yes | PyPI package name to inspect |
Review a package during pull requests:
name: Dependency Trust Check
on:
pull_request:
jobs:
trustcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Inspect requests
uses: Halfblood-Prince/trustcheck-action@v1
with:
package: requestsRun an on-demand inspection:
name: Manual TrustCheck
on:
workflow_dispatch:
jobs:
trustcheck:
runs-on: ubuntu-latest
steps:
- name: Inspect sampleproject
uses: Halfblood-Prince/trustcheck-action@v1
with:
package: sampleprojectAccording to the core TrustCheck documentation, trustcheck inspect can evaluate:
- project and release metadata from PyPI
- declared repository URLs
- provenance envelopes for release artifacts
- attestation verification against artifact digests
- Trusted Publisher identity details such as repository and workflow
- expected repository matching
- publisher repository and workflow drift between releases
- vulnerability records for the selected version
- text or JSON output for operators and automation
Recommendation tiers in the core project include verified, metadata-only, review-required, and high-risk.
The current GitHub Action is intentionally minimal. It only exposes the package input and runs the default trustcheck inspect command.
If you need advanced TrustCheck behavior documented in the core project, such as:
--version--expected-repo--strict--policyor--policy-file--format json--verbose--config-file--cache-diror--offline
use the core CLI directly in your workflow today, or extend this action to expose those flags as additional inputs.
If you want stricter policy enforcement right now, install and run the CLI directly:
name: Verify Dependency Trust
on:
pull_request:
workflow_dispatch:
jobs:
trustcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install TrustCheck
run: python -m pip install --upgrade pip trustcheck
- name: Inspect pinned release with strict policy
run: |
trustcheck inspect sampleproject \
--version 4.0.0 \
--expected-repo https://github.com/pypa/sampleproject \
--strictFrom the core CLI documentation:
0means success1means upstream PyPI or network failure2means command usage error3means invalid response or internal processing failure4means policy failure
In CI, a policy failure is useful: it means TrustCheck ran correctly and intentionally blocked the package under the selected policy.
- Core project: https://github.com/Halfblood-Prince/trustcheck
- Documentation: https://halfblood-prince.github.io/trustcheck/
- PyPI package: https://pypi.org/project/trustcheck/
This repository is source-available under the TrustCheck Action Personal Use License.
Private and commercial use of the official published Halfblood-Prince/trustcheck-action GitHub Action is permitted under the GitHub Action Use Exception included in LICENSE.
The exception applies to using the official action in workflows. It does not grant broad rights to copy, modify, redistribute, sublicense, or republish this repository's source code outside that context.