← Docs

GitHub Action

Fail the build when Content Credentials go missing, and check production URLs after a deploy.

- uses: c2pa-design/c2pa-check/action@v0.6.2
  with:
    paths: "public/**/*.{jpg,png,webp}"
    coverage: 100
    trust: official
    format: junit

Inputs

Input Default Meaning
paths — Glob of files to verify; empty with empty urls runs the checks in c2pa.json
urls — Newline-separated production URLs
coverage 100 Fail below this percentage trusted
coverage-metric trusted What coverage counts: trusted, traced or valid
baseline — Fail when a file that had a valid credential in this baseline file has lost it
expect — present, trusted or absent
trust official official, interim, both or none
format text text, json or junit
output — Write the report to this file instead of the log
register false true registers the checked files after the check (needs C2PA_API_KEY)
carry false true carries credentials from originals in from-dir into the files matched by paths first
from-dir — Folder of signed originals, paired by file name (with carry)
version v0.6.2 Release of c2pa-check to run, checked against the release's SHA256SUMS

Output: coverage, the percentage a verifier would call trusted (with format: text).

The action lives in the open-source c2pa-check repository and is versioned with the CLI: the tag after @ is the release you run. To upgrade, change the tag.

The build-time check

name: provenance
on: [pull_request]
jobs:
  credentials:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: c2pa-design/c2pa-check/action@v0.6.2
        with:
          paths: "public/images/**/*.{jpg,png,webp}"
          coverage: 100

This catches a build step that strips metadata. It does not catch a CDN that strips it later, because the CDN is not in the repository.

The post-deploy check

      - uses: c2pa-design/c2pa-check/action@v0.6.2
        with:
          urls: |
            https://cdn.example.com/hero.jpg
            https://cdn.example.com/w800/hero.jpg
          expect: trusted

This is the one that finds real problems, because it tests what your users receive. It is also the bridge to monitoring: a deploy check runs when you deploy, and a monitor runs when a vendor changes something on a Tuesday afternoon.

Reading the failure

42 scanned · 37 trusted · 5 missing
  missing: public/images/hero-2.jpg
  missing: public/images/team-4.jpg
coverage 88.1%   monitor production provenance at https://c2pa.design

format: junit writes the same result as a test report, so the annotations land on the pull request.