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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ updates:
# moves as one set.
pi:
patterns: ["@earendil-works/*"]
vitest:
patterns: ["vitest", "@vitest/*"]
minor-and-patch:
update-types: ["minor", "patch"]
security:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
security-events: write
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pi-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
canary:
name: Check against latest pi
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -31,6 +32,9 @@ jobs:
run: npm ci --ignore-scripts

- name: Upgrade pi packages to latest
# Installing the newest unlocked release is the point of this job; it holds
# only contents: read and runs no install scripts.
# zizmor: ignore[adhoc-packages]
run: npm install --no-save --ignore-scripts @earendil-works/pi-agent-core@latest @earendil-works/pi-ai@latest @earendil-works/pi-coding-agent@latest @earendil-works/pi-tui@latest

- name: Report the versions under test
Expand Down
49 changes: 48 additions & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
# A superseded push to a pull request is dead weight; cancel it. Every main commit needs
# its own result and its own Sonar main-branch analysis, so a push gets a group of its own:
# a shared group holds one pending run, and a third push replaced the second's.
# Releases are unaffected (publish.yaml has no concurrency group).
# Releases are unaffected (publish.yaml has a group of its own).
concurrency:
group: pr-check-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
Expand All @@ -24,6 +24,7 @@ jobs:
check:
name: Biome, Types & Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 15
permissions:
contents: read
strategy:
Expand Down Expand Up @@ -55,6 +56,9 @@ jobs:
# execute in every PR.
run: npm ci --ignore-scripts

- name: Verify provenance signatures
run: npm audit signatures

- name: Check
run: npm run check

Expand All @@ -81,6 +85,7 @@ jobs:
smoke:
name: Headless e2e smoke
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
Expand All @@ -107,3 +112,45 @@ jobs:
# asserts the exact provider payload; no real model or network needed.
shell: bash
run: bash scripts/e2e-smoke.sh

zizmor:
name: Workflow audit (zizmor)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: false

- name: Audit workflows
run: uvx zizmor@1.32.0 --config .github/zizmor.yml --format=plain .github/workflows

ci:
# The single status a ruleset can require: it stays red unless every job above
# succeeded. None of them is conditional, so a skipped job counts as a failure.
name: CI
needs: [check, smoke, zizmor]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
permissions: {}
steps:
- name: Require every job to succeed
env:
RESULTS: ${{ toJSON(needs.*.result) }}
run: |
set -euo pipefail
echo "Job results: $RESULTS"
if jq -e 'all(.[]; . == "success")' <<< "$RESULTS" > /dev/null; then
exit 0
fi
echo "At least one required job did not succeed." >&2
exit 1
15 changes: 14 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ on:
permissions:
contents: read

# One publish at a time, and never cancel one midway: a cancelled run can leave a
# release with its attestation uploaded but the package unpublished.
concurrency:
group: publish
cancel-in-progress: false

jobs:
# The check runs the dev toolchain (vitest, biome, knip, tsc) and every devDependency it
# loads, so it holds no token: a compromised one cannot mint the OIDC token the build
# signs with or touch the tarball before it is packed and attested.
check:
name: Check
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
Expand All @@ -39,7 +46,9 @@ jobs:
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.x
cache: npm
# No cache anywhere in a release run: a poisoned cache entry would feed
# the commit that gets tagged, packed and published.
package-manager-cache: false

- name: Install dependencies
run: npm ci --ignore-scripts
Expand All @@ -51,6 +60,7 @@ jobs:
name: Build, attest, and pack
needs: [check]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write # upload the attestation bundle to the triggering release
id-token: write # OIDC token for Sigstore keyless signing
Expand All @@ -74,6 +84,7 @@ jobs:
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Verify the tag matches package.json
env:
Expand Down Expand Up @@ -132,6 +143,7 @@ jobs:
name: Publish to npm
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write # npm provenance attestation via OIDC trusted publisher
Expand All @@ -141,6 +153,7 @@ jobs:
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Download tarball artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
Expand Down
6 changes: 6 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rules:
unpinned-uses:
config:
policies:
# Every action, first-party included, is pinned to a full commit SHA.
"*": hash-pin
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.6.6/schema.json",
"$schema": "https://biomejs.dev/schemas/2.6.8/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
Expand Down
Loading