Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

fix(ci): publish reports through approved reusable workflow wrappers (#330)

Christopher Kevinacfb793b40d3
diff --git a/.github/workflows/publish-skill-reports.yml b/.github/workflows/publish-skill-reports.yml
index d8dc90e5..a682e764 100644
--- a/.github/workflows/publish-skill-reports.yml
+++ b/.github/workflows/publish-skill-reports.yml
@@ -32,6 +32,10 @@ on:
description: Approved Git blobs for the consumer scan workflow, separated by commas or newlines
type: string
required: true
+ trusted-wrapper-workflows:
+ description: Optional approved wrapper workflow paths pinned by full SHA, separated by commas or newlines
+ type: string
+ default: ''
permissions:
contents: read
jobs:
@@ -100,6 +104,7 @@ jobs:
PAGES_BASE_URL: ${{ inputs.report-base-url }}
TRUSTED_EVALUATOR_SHA: ${{ inputs.trusted-evaluator-shas }}
TRUSTED_CALLER_BLOBS: ${{ inputs.trusted-caller-blobs }}
+ TRUSTED_WRAPPER_WORKFLOWS: ${{ inputs.trusted-wrapper-workflows }}
EVALUATOR_REPOSITORY: ${{ inputs.tools-repository }}
run: |
export SITE_DIR="$GITHUB_WORKSPACE/site" OUTPUT_DIR="$RUNNER_TEMP/report-feedback"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a314fa2a..c4f8e874 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,10 @@ All notable changes to SkillEvaluator are documented in this file.
### Added
+- Allow hosted CI reports and PR comments from scans called through explicitly
+ approved reusable workflow wrappers. Direct callers retain the existing setup;
+ signed evaluator identity and exact consumer workflow approvals remain required.
+
- Include `skillevaluator ci init`, `ci status` and `ci demo` in the Python
package. Guided GitHub onboarding discovers skills, configures checks and
optional public hosted reports, and opens a reviewable setup PR. An optional
diff --git a/ci/README.md b/ci/README.md
index f3796919..f7a48a54 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -108,7 +108,8 @@ Pages is not an inherent requirement for GitHub PR comments.
4. Keep the scan filename `.github/workflows/skill-checks.yml`, workflow name
**Skill checks**, and artifact name **skill-evaluator-tier1**. The dedicated
publisher validates this caller and accepts exactly one approved referenced
- evaluator workflow. A differently named manual LLM workflow is not accepted
+ evaluator workflow, plus explicitly approved wrappers as described below.
+ A differently named manual LLM workflow is not accepted
automatically. The publisher reads only the attempt's
`skill-evaluator-tier1-evidence-attempt-N` artifact. A scan from an
evaluator revision that does not upload it cannot be published. Re-running
@@ -165,6 +166,50 @@ Fork PR scans can run without provider secrets; fork PR bot comments and current
PR aliases are not enabled. Comment-only operation and hosting alongside an
arbitrary existing Pages deployment need further integration work.
+### Calling through a shared workflow
+
+Direct consumers need no wrapper configuration. If the scan calls a shared
+workflow that then calls SkillEvaluator, use a reviewed publisher revision that
+exposes `trusted-wrapper-workflows`. The archived 0.7.1 publisher pin predates
+this support; adding the input to that older workflow does not enable it.
+Update both the publisher job's `uses:` revision and its `tools-ref` to that
+reviewed publisher commit. The evaluator workflow and image can keep their
+existing approved pins.
+
+In the consumer's publisher workflow, approve each additional workflow by its
+full repository path and immutable commit:
+
+```yaml
+with:
+ trusted-wrapper-workflows: |-
+ your-org/shared-ci/.github/workflows/skill-checks.yml@FULL_COMMIT_SHA
+```
+
+Replace `FULL_COMMIT_SHA` with the reviewed 40-character commit. Multiple wrappers
+can be separated by newlines or commas. Each referenced wrapper must be approved;
+branch and tag references are rejected. Continue approving the actual evaluator
+in `trusted-evaluator-shas` and the consumer scan file in `trusted-caller-blobs`.
+Review any wrapper update and refresh its pin in both the calling workflow and
+publisher approval list; refresh the consumer blob after editing its scan file.
+
+The consumer scan job **and every wrapper job calling the next workflow** need:
+
+```yaml
+permissions:
+ contents: read
+ id-token: write
+```
+
+An intermediate job that grants only `contents: read` removes the identity
+permission, so the scan cannot produce its signed publication receipt. Start a
+new scan after configuring the chain. Keep the scan workflow name, filename and
+artifact name listed above. Wrappers forward `paths`, thresholds and other scan
+choices normally. They do not need PR-write or Pages-write permissions.
+
+The publisher verifies the signed identity of the evaluator job and the exact
+consumer workflow. It records approved wrapper identities in the publication
+receipt. Private repositories still need appropriately restricted report hosting.
+
Basic scans do not request identity credentials. If GitHub withholds the signing
permission (including under fork policies), the scan and downloadable reports
remain available, but hosting is skipped with a setup message. Historical runs
diff --git a/ci/publish_reports.py b/ci/publish_reports.py
index 55c1633e..86431409 100644
--- a/ci/publish_reports.py
+++ b/ci/publish_reports.py
@@ -497,19 +497,53 @@ def _caller_blob(api, repository: str, sha: str) -> str:
return caller["sha"]
-def _validate_workflow_provenance(api, repository: str, run: dict) -> None:
+def _trusted_wrappers() -> set[str]:
+ raw = os.environ.get("TRUSTED_WRAPPER_WORKFLOWS", "").strip()
+ if not raw:
+ return set()
+ values = [value.strip() for value in re.split(r"[,\n]", raw)]
+ pattern = r"[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+/\.github/workflows/[A-Za-z0-9_-][A-Za-z0-9_.-]*\.ya?ml@[0-9a-f]{40}"
+ if len(raw) > 32768 or len(values) > 32 or any(re.fullmatch(pattern, value) is None for value in values):
+ raise PublicationError("Approved wrappers require owner/repository/.github/workflows/file.yml@<full SHA> pins.")
+ return set(values)
+
+
+def _validate_workflow_provenance(api, repository: str, run: dict) -> dict:
evaluator_pins = _trusted_pins("TRUSTED_EVALUATOR_SHA")
caller_blobs = _trusted_pins("TRUSTED_CALLER_BLOBS")
+ approved_wrappers = _trusted_wrappers()
references = run.get("referenced_workflows")
- if not isinstance(references, list) or len(references) != 1 or not isinstance(references[0], dict):
- raise PublicationError("The scan must reference exactly one approved reusable evaluator workflow.")
- reference = references[0]
- sha = reference.get("sha")
+ if not isinstance(references, list) or not 1 <= len(references) <= 33:
+ raise PublicationError("The scan must reference one approved evaluator and only explicitly approved wrappers.")
evaluator_repository = os.environ.get("EVALUATOR_REPOSITORY", "NVIDIA/SkillEvaluator")
if not REPO_PATTERN.fullmatch(evaluator_repository):
raise PublicationError("The approved evaluator repository identity is invalid.")
workflow = f"{evaluator_repository}/.github/workflows/evaluate-skills.yml"
- if sha not in evaluator_pins or reference.get("path") != f"{workflow}@{sha}":
+ evaluator_sha = None
+ seen = set()
+ wrappers = set()
+ for reference in references:
+ if not isinstance(reference, dict):
+ raise PublicationError("The scan has an invalid workflow reference.")
+ path, sha = reference.get("path"), reference.get("sha")
+ if (
+ not isinstance(path, str)
+ or not isinstance(sha, str)
+ or SHA_PATTERN.fullmatch(sha) is None
+ or not path.endswith(f"@{sha}")
+ or path in seen
+ ):
+ raise PublicationError("The scan has a duplicate or non-immutable workflow reference.")
+ seen.add(path)
+ if path == f"{workflow}@{sha}" and sha in evaluator_pins:
+ if evaluator_sha is not None:
+ raise PublicationError("The scan must reference exactly one approved evaluator.")
+ evaluator_sha = sha
+ elif path in approved_wrappers and not path.startswith(f"{workflow}@"):
+ wrappers.add(path)
+ else:
+ raise PublicationError("The scan references an unapproved evaluator or wrapper workflow.")
+ if evaluator_sha is None:
raise PublicationError("The selected run did not use an approved immutable evaluator workflow.")
# The receipt is a separate artifact made by the trusted reusable workflow.
# PR associations and current merge refs are mutable, so they never identify
@@ -523,12 +557,13 @@ def _validate_workflow_provenance(api, repository: str, run: dict) -> None:
repository=repository,
run=run,
evaluator_workflow=workflow,
- evaluator_sha=sha,
+ evaluator_sha=evaluator_sha,
)
except ProvenanceError as exc:
raise PublicationError(str(exc)) from exc
if _caller_blob(api, repository, identity["workflow_sha"]) not in caller_blobs:
raise PublicationError("The caller workflow differs from the approved workflow blobs.")
+ return {"evaluator_sha": evaluator_sha, "wrapper_workflows": sorted(wrappers)}
def _timestamp(value: str) -> datetime:
@@ -787,7 +822,7 @@ def publish(
_validate_run(run, repository, run_id)
if run["run_attempt"] != run_attempt:
raise PublicationError("GitHub returned a different workflow attempt from the requested one.")
- _validate_workflow_provenance(api, repository, run)
+ provenance = _validate_workflow_provenance(api, repository, run)
artifact = _select_artifact(api, repository, run)
summary, reports = read_artifact(api.download_artifact(artifact["id"]))
successful = summary["overall_passed"] or summary["overall_status"] == "skipped"
@@ -813,8 +848,10 @@ def publish(
"overall_status": summary["overall_status"],
"ci_conclusion": run["conclusion"],
"event": run["event"],
- "trusted_evaluator_sha": run["referenced_workflows"][0]["sha"],
+ "trusted_evaluator_sha": provenance["evaluator_sha"],
}
+ if provenance["wrapper_workflows"]:
+ receipt["trusted_wrapper_workflows"] = provenance["wrapper_workflows"]
if selected_image:
receipt["image"] = selected_image
destination = site / relative
diff --git a/ci/templates/publish-skill-reports.yml b/ci/templates/publish-skill-reports.yml
index 8a89c4e3..dee8015e 100644
--- a/ci/templates/publish-skill-reports.yml
+++ b/ci/templates/publish-skill-reports.yml
@@ -34,5 +34,7 @@ jobs:
report-base-url: YOUR_REPORT_BASE_URL
trusted-evaluator-shas: RELEASE_WORKFLOW_SHA
trusted-caller-blobs: YOUR_APPROVED_CALLER_BLOB
+ # When the scan calls through shared wrappers, approve each full workflow path@SHA.
+ # trusted-wrapper-workflows: your-org/shared-ci/.github/workflows/skill-checks.yml@FULL_COMMIT_SHA
tools-ref: RELEASE_WORKFLOW_SHA
tools-repository: NVIDIA/SkillEvaluator
diff --git a/docs/github-actions.mdx b/docs/github-actions.mdx
index 307b0def..094eb933 100644
--- a/docs/github-actions.mdx
+++ b/docs/github-actions.mdx
@@ -192,6 +192,20 @@ or let the [CLI](/skills/skillevaluator/cli-onboarding) handle it.
rerunning an old job keeps its original workflow. The scan's downloadable
report remains a separate way to inspect available findings.
</Accordion>
+ <Accordion title="Our organization uses a shared workflow wrapper">
+ Each repository still supplies its own skill folders. To publish results
+ through a shared wrapper, use a publisher revision with the
+ `trusted-wrapper-workflows` input and approve each wrapper by its full
+ workflow path and commit SHA. The archived 0.7.1 publisher does not have
+ this input. Direct callers need no wrapper approval.
+
+ Grant `id-token: write` in the consumer scan job and every wrapper job
+ calling the next workflow. Keep the existing evaluator and consumer-file
+ approvals, then start a new scan. Follow the
+ [shared-workflow setup](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/README.md#calling-through-a-shared-workflow)
+ for the YAML and update procedure. PR comments still follow successful
+ report deployment; internal reports need appropriately restricted hosting.
+ </Accordion>
<Accordion title="Do the checks need an LLM key or network access?">
Default Tier 1 checks use no model key. Dependency audits can contact
vulnerability services and submit package metadata; packages are not
diff --git a/tests/ci/test_publish_reports.py b/tests/ci/test_publish_reports.py
index 4fe5df54..98e4cd6f 100644
--- a/tests/ci/test_publish_reports.py
+++ b/tests/ci/test_publish_reports.py
@@ -705,8 +705,16 @@ def test_scan_evidence_upload_holds_exactly_what_the_publisher_reads(tmp_path):
]["steps"]
uploads = [step for step in steps if step.get("uses", "").startswith("actions/upload-artifact@")]
assert len(uploads) == 3
- full = next(step for step in uploads if step["with"]["name"] == "${{ inputs.artifact-name }}-attempt-${{ github.run_attempt }}")
- evidence = next(step for step in uploads if step["with"]["name"] == "${{ inputs.artifact-name }}-evidence-attempt-${{ github.run_attempt }}")
+ full = next(
+ step
+ for step in uploads
+ if step["with"]["name"] == "${{ inputs.artifact-name }}-attempt-${{ github.run_attempt }}"
+ )
+ evidence = next(
+ step
+ for step in uploads
+ if step["with"]["name"] == "${{ inputs.artifact-name }}-evidence-attempt-${{ github.run_attempt }}"
+ )
assert evidence["uses"] == full["uses"] and evidence["if"] == full["if"] == "always()"
assert evidence["with"]["name"] == "${{ inputs.artifact-name }}-evidence-attempt-${{ github.run_attempt }}"
assert evidence["with"]["retention-days"] == full["with"]["retention-days"]
@@ -1193,6 +1201,97 @@ def test_explicit_fork_evaluator_identity_is_required(monkeypatch):
publisher._validate_workflow_provenance(FakeAPI(record=record), "owner/consumer", record)
+WRAPPER = "example/shared/.github/workflows/skills.yml@" + "e" * 40
+SECOND_WRAPPER = "example/platform/.github/workflows/check.yml@" + "f" * 40
+EVALUATOR = "NVIDIA/SkillEvaluator/.github/workflows/evaluate-skills.yml@" + "c" * 40
+
+
+class NestedAPI(FakeAPI):
+ def download_artifact(self, artifact_id):
+ if artifact_id == 457:
+ # GitHub signs the leaf job identity, independent of API reference order.
+ return signed_receipt(self.record, job_workflow_ref=EVALUATOR, job_workflow_sha="c" * 40)
+ return super().download_artifact(artifact_id)
+
+
[email protected]("event", ["push", "pull_request", "workflow_dispatch"])
[email protected]("wrappers", [[], [WRAPPER], [WRAPPER, SECOND_WRAPPER]])
[email protected]("reverse", [False, True])
+def test_approved_wrappers_preserve_leaf_identity_and_direct_publication(
+ tmp_path, monkeypatch, event, wrappers, reverse
+):
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", "\n".join(wrappers))
+ paths = [*wrappers, EVALUATOR]
+ if reverse:
+ paths.reverse()
+ record = {
+ **run_record(),
+ "event": event,
+ "referenced_workflows": [{"path": path, "sha": path.rsplit("@", 1)[1]} for path in paths],
+ }
+ publisher.publish(
+ NestedAPI(record=record),
+ "owner/consumer",
+ 123,
+ "https://owner.github.io/consumer",
+ tmp_path / "site",
+ tmp_path / "output",
+ render=fake_render,
+ )
+ receipt = json.loads((tmp_path / "site/runs/123/1/receipt.json").read_text())
+ assert receipt["trusted_evaluator_sha"] == "c" * 40
+ if wrappers:
+ assert receipt["trusted_wrapper_workflows"] == sorted(wrappers)
+ else:
+ assert "trusted_wrapper_workflows" not in receipt
+
+
+ "approved, paths",
+ [
+ ("", [WRAPPER, EVALUATOR]),
+ (SECOND_WRAPPER, [WRAPPER, EVALUATOR]),
+ (WRAPPER, [WRAPPER, SECOND_WRAPPER, EVALUATOR]),
+ (WRAPPER, [WRAPPER, WRAPPER, EVALUATOR]),
+ (WRAPPER, [WRAPPER, EVALUATOR, EVALUATOR]),
+ (WRAPPER, [WRAPPER]),
+ (WRAPPER.replace("e" * 40, "main"), [WRAPPER, EVALUATOR]),
+ (WRAPPER + ",", [WRAPPER, EVALUATOR]),
+ (WRAPPER.replace("skills.yml", "../skills.yml"), [WRAPPER, EVALUATOR]),
+ (",".join([WRAPPER] * 33), [WRAPPER, EVALUATOR]),
+ ],
+)
+def test_wrapper_trust_rejects_unapproved_ambiguous_or_mutable_references(monkeypatch, approved, paths):
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", approved)
+ record = {**run_record(), "referenced_workflows": [{"path": path, "sha": path.rsplit("@", 1)[1]} for path in paths]}
+ with pytest.raises(publisher.PublicationError):
+ publisher._validate_workflow_provenance(NestedAPI(record=record), "owner/consumer", record)
+
+
[email protected]("failure", ["caller", "receipt", "sha"])
+def test_wrapper_approval_does_not_bypass_caller_receipt_or_sha_validation(monkeypatch, failure):
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", WRAPPER)
+ record = run_record()
+ record["referenced_workflows"].insert(0, {"path": WRAPPER, "sha": "e" * 40})
+ if failure == "sha":
+ record["referenced_workflows"][0]["sha"] = "f" * 40
+
+ class BadAPI(NestedAPI):
+ def get(self, path):
+ result = super().get(path)
+ if failure == "caller" and "/contents/" in path:
+ return {**result, "sha": "f" * 40}
+ return result
+
+ def download_artifact(self, artifact_id):
+ if failure == "receipt" and artifact_id == 457:
+ return signed_receipt(self.record, job_workflow_ref=WRAPPER, job_workflow_sha="e" * 40)
+ return super().download_artifact(artifact_id)
+
+ with pytest.raises(publisher.PublicationError):
+ publisher._validate_workflow_provenance(BadAPI(record=record), "owner/consumer", record)
+
+
def test_missing_receipt_is_a_skipped_publisher_run(tmp_path, monkeypatch):
class LegacyAPI(FakeAPI):
def get(self, path):