diff --git a/.github/workflows/boj-build.yml b/.github/workflows/boj-build.yml index deaa98e..5793bda 100644 --- a/.github/workflows/boj-build.yml +++ b/.github/workflows/boj-build.yml @@ -1,25 +1,70 @@ # This workflow is managed by gh actions-lock. # SPDX-License-Identifier: MPL-2.0 -# This workflow is managed by gh actions-lock. -# This workflow is managed by gh actions-lock. +# +# OPTIONAL: BoJ Server Build Trigger. +# Notifies a BoJ server that this repository was pushed, so its Casket +# (ssg-mcp) cartridge rebuilds the site. The endpoint comes from the +# BOJ_SERVER_URL secret or variable and must be https; the job is a no-op +# when it is unset, and a non-fatal skip when the server is unreachable. +# It used to POST in clear text to a hard-coded boj-server.local:7700, an +# mDNS name a GitHub-hosted runner cannot resolve, so the step always failed, +# and it wrote the GitHub context straight into the script text. +# This is the form standards' and chora-registry's boj-build.yml use. name: BoJ Server Build Trigger + on: push: branches: [main, master] workflow_dispatch: + +# Cancel superseded runs; the job only sends a notification. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read + jobs: trigger-boj: + name: Trigger BoJ server runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Trigger BoJ Server (Casket/ssg-mcp) + # GitHub context goes through env, never into the script text. + env: + BOJ_URL: ${{ secrets.BOJ_SERVER_URL || vars.BOJ_SERVER_URL }} + REPO_NAME: ${{ github.repository }} + BRANCH_NAME: ${{ github.ref_name }} run: | - # Send a secure trigger to boj-server to build this repository - curl -X POST "http://boj-server.local:7700/cartridges/ssg-mcp/invoke" \ + set -euo pipefail + + if [ -z "${BOJ_URL:-}" ]; then + echo "BOJ_SERVER_URL not configured - skipping" + exit 0 + fi + case "$BOJ_URL" in + https://*) ;; + *) + echo "::warning::BOJ_SERVER_URL is not an https URL - skipping (estate rule: HTTPS only)" + exit 0 + ;; + esac + + payload="$(jq -cn \ + --arg repo "$REPO_NAME" \ + --arg branch "$BRANCH_NAME" \ + --arg engine "casket" \ + '{repo: $repo, branch: $branch, engine: $engine}')" + + curl -sSf --proto '=https' --max-time 60 -X POST \ + "${BOJ_URL%/}/cartridges/ssg-mcp/invoke" \ -H "Content-Type: application/json" \ - -d "{\"repo\": \"${{ github.repository }}\", \"branch\": \"${{ github.ref_name }}\", \"engine\": \"casket\"}" - continue-on-error: true + --data "$payload" \ + || echo "::warning::BoJ server unreachable - skipping (non-fatal)" diff --git a/panic-attack_chora.deed b/panic-attack_chora.deed index 91175dc..14d84ea 100644 --- a/panic-attack_chora.deed +++ b/panic-attack_chora.deed @@ -147,4 +147,16 @@ :note "T0 syntax heuristics are labelled T0. A finding is never dressed up as a parser or dataflow proof; see docs/RECON-AND-EVIDENCE.adoc") (obligation :name "no-self-suppression" - :note "suppressions live in a separate registry file (audits/assail-classifications_praxis.deed) so one hand cannot both add a defect and hide it")) + :note "suppressions live in a separate registry file (audits/assail-classifications_praxis.deed) so one hand cannot both add a defect and hide it") + ; Declared egress for secret-bearing jobs (standards ADR-009; Hypatia RE001). + ; trigger-boj POSTs to the BoJ server named by BOJ_SERVER_URL (a secret or a + ; variable), over https only; nothing holds it to that host at run time. + (egress + :policy "standards ADR-009" + (job + :workflow ".github/workflows/boj-build.yml" + :job "trigger-boj" + :secrets ("BOJ_SERVER_URL") + :endpoints ("secret:BOJ_SERVER_URL" "var:BOJ_SERVER_URL") + :enforcement none + :reason "optional build notification; the URL is configuration, held as a secret or a variable")))