Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/trusted-skill-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ on:
- 'skills/**/*.yaml'

# This workflow has access to the LLM credential. It must only execute code
# checked out from the trusted base commit; pull-request files are fetched as
# data through the contents API and are never sourced or executed.
# checked out from the commit that supplied this workflow; pull-request files
# are fetched as data through the contents API and are never sourced or
# executed.
permissions: {}

jobs:
Expand Down Expand Up @@ -155,7 +156,10 @@ jobs:
- name: Checkout trusted scan implementation
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.base.sha }}
# pull_request.base.sha can remain at an older merge base after main
# advances. workflow_sha is the exact trusted revision from which
# GitHub loaded this pull_request_target workflow.
ref: ${{ github.workflow_sha }}
persist-credentials: false

- name: Fetch proposed specification as data
Expand Down
9 changes: 6 additions & 3 deletions docs/trusted-skill-scan-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ workflow validates specifications and confirms that the proposed skill can be
packaged, but it does not run the LLM-backed scanner or publish artifacts.

`trusted-skill-scan.yml` has access to the scanner credential. It checks out
the workflow and scanner implementation from the trusted base commit. It
fetches each proposed `spec.yaml` through the GitHub contents API and treats
the file as data. Pull request code is never executed in this workflow.
the workflow and scanner implementation from `github.workflow_sha`, the exact
trusted commit from which GitHub loaded the `pull_request_target` workflow.
This avoids using `pull_request.base.sha`, which can remain at an older merge
base after `main` advances. The workflow fetches each proposed `spec.yaml`
through the GitHub contents API and treats the file as data. Pull request code
is never executed in this workflow.

The trusted workflow also enforces the following boundaries:

Expand Down
Loading