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
9 changes: 3 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE/knowledge-sync.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<!-- A sidecar sync. The lines above this template are the sync's: the release, the files it changed and the pin. The workflow leaves the sidecar's checks to this pull request's own checks; a sync opened by hand with .lokf/scripts/knowledge-sync.sh --pr <tag> writes its check lines above too. -->
<!-- A sidecar sync. The lines above are the sync's report: the release, the files it changed and the pin. -->

## Reviewer checklist

- [ ] The diff touches only the sidecar's copies, the site's copies, `.lokf/pyproject.toml`, `.lokf/uv.lock` and `CHANGELOG.md`.
- [ ] `.lokf/pyproject.toml` changes on the `ktl` line alone, to the release, and `.lokf/uv.lock` on the `ktl` entry alone.
- [ ] Any workflow changes held above are read and applied on this branch, or left for the next sync on purpose.
- [ ] You read the [release notes of Knowledge Trust Ladder](https://w3id.org/ktl/changelog/) for a step the sync cannot do, such as setting a new variable or secret. If there is one, you do it in this pull request or straight after the merge.
- [ ] `CHANGELOG.md` has the entry under `## [Unreleased]` and `### Security`, and the title carries `security(sidecar):`, so the merge releases.
- [ ] The diff changes only the sidecar's copies, the site's copies, the `ktl` pin and its lock, and `CHANGELOG.md`.
- [ ] Any workflow changes held above are read and applied on this branch.
22 changes: 16 additions & 6 deletions .github/workflows/knowledge-librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
record: ${{ steps.read.outputs.record }}
steps:
- name: Harden the runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit

Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
# installs packages, installs a skill everywhere but the repository
# that publishes it, and runs a third-party agent.
- name: Harden the runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit

Expand All @@ -179,8 +179,13 @@ jobs:
# trusts the wheels it unpacked there without hashing them again. So a
# cache this job saved after the agent ran could be what the release
# restores and packs.
# A runner that holds uv keeps its own; setup-uv fetches one from github.com.
- name: Find uv on the runner
id: uv
run: if command -v uv >/dev/null 2>&1; then echo "found=true" >> "$GITHUB_OUTPUT"; fi
- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
if: steps.uv.outputs.found != 'true'
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
python-version: "3.12"
enable-cache: false
Expand Down Expand Up @@ -417,7 +422,7 @@ jobs:
conventions_outcome: ${{ steps.conventions.outcome }}
steps:
- name: Harden the runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit

Expand All @@ -431,8 +436,13 @@ jobs:

# No uv cache, as in `refresh`, so nothing the agent's job unpacked is
# what this job's checks run on.
# A runner that holds uv keeps its own; setup-uv fetches one from github.com.
- name: Find uv on the runner
id: uv
run: if command -v uv >/dev/null 2>&1; then echo "found=true" >> "$GITHUB_OUTPUT"; fi
- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
if: steps.uv.outputs.found != 'true'
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
python-version: "3.12"
enable-cache: false
Expand Down Expand Up @@ -548,7 +558,7 @@ jobs:
pull-requests: write # open the review PR
steps:
- name: Harden the runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit

Expand Down
276 changes: 187 additions & 89 deletions .github/workflows/knowledge-registrar.yaml

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions .github/workflows/knowledge-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,18 @@ jobs:
TAG: ${{ inputs.tag || github.event.release.tag_name }}
steps:
- name: Harden the runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit

# The input is held to the shape of a tag before anything names a ref by it.
- name: Check the tag is a release tag
run: |
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::'$TAG' is not vMAJOR.MINOR.PATCH."
exit 1
fi
# The bundle as it stood at the tag, not at the branch head.
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -232,9 +240,14 @@ jobs:
# .lokf/uv.lock. A cache is shared by every job on the default branch,
# the librarian's agent job among them, and uv trusts the wheels it
# unpacked there without hashing them again.
- name: Set up uv
# A runner that holds uv keeps its own; setup-uv fetches one from github.com.
- name: Find uv on the runner
id: uv
if: steps.compare.outputs.changed == 'true'
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
run: if command -v uv >/dev/null 2>&1; then echo "found=true" >> "$GITHUB_OUTPUT"; fi
- name: Set up uv
if: steps.compare.outputs.changed == 'true' && steps.uv.outputs.found != 'true'
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
python-version: "3.12"
enable-cache: false
Expand Down Expand Up @@ -579,7 +592,7 @@ jobs:
TAG: ${{ inputs.tag || github.event.release.tag_name }}
steps:
- name: Harden the runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit

Expand Down Expand Up @@ -638,5 +651,11 @@ jobs:
GH_REPO: ${{ github.repository }}
run: |
shopt -s nullglob
gh release upload "$TAG" ./*.zip ./*.yaml ./*.tsv ./*.sha256 ./*.intoto.jsonl --clobber
# gh retries a slow upload itself, and a retry of one that reached
# GitHub fails with "already exists"; --clobber makes a new attempt safe.
for attempt in 1 2 3; do
gh release upload "$TAG" ./*.zip ./*.yaml ./*.tsv ./*.sha256 ./*.intoto.jsonl --clobber && exit 0
[ "$attempt" = 3 ] || { echo "::warning::The upload to $TAG failed (attempt $attempt); trying again."; sleep 15; }
done
exit 1
working-directory: ${{ runner.temp }}/release
Loading
Loading