diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0d0a900..4d75534 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -91,17 +91,10 @@ updates: # devantler-tech actions/workflows are our own code — bump now, no cooldown. exclude: - "devantler-tech/*" - # The application publisher stays on the exact revision Platform has reviewed and approved - # for this tenant, which CI's publish-app pin check enforces. Every devantler-tech/.github - # release moves the publisher's tag together with the callers below, so while Dependabot - # proposed it, every group pull request needed a hand fix putting the publisher back (#437, - # #459, issue #468). Move this pin by hand, in its own change, once Platform approves a newer - # revision. - ignore: - - dependency-name: "devantler-tech/.github/.github/workflows/publish-app.yaml" # The maintained release and template-sync callers must share one commit. Grouping avoids - # divergent bumps; the publisher is ignored above, so the group never waits for a Platform - # approval. + # divergent bumps. The publish-app action moves with them: releases are signed by this + # repository's own cd.yaml on its tag, whatever action revision runs (devantler-tech/monorepo + # ADR 0017), so a new revision needs no Platform approval. groups: devantler-tech-actions: patterns: diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 8bbf349..5f70310 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -10,30 +10,37 @@ permissions: {} jobs: publish: name: Publish - # Skipped in the template repo itself (it ships no app); runs in every tenant - # created from this template. The template is matched by its repository ID, - # which survives the rename from platform-tenant-template to application-template. + # The upstream template has no application to publish; its ID survives renames. if: github.repository_id != '1253884448' + runs-on: ubuntu-latest + timeout-minutes: 60 + # Serialize this repository's publishers and never cancel one mid-release. + concurrency: + group: publish-${{ github.repository }} + queue: max + cancel-in-progress: false permissions: - contents: read # checkout - packages: write # push image + manifests OCI artifact - id-token: write # keyless cosign signing (via GitHub OIDC) - uses: devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 # v19.0.5 - with: - # publish-app pins the freshly built image digest into the container with - # this name in deploy/deployment.yaml. Keep that container's name equal to - # the repository name (the platform's signed-publish convention). - app-name: ${{ github.event.repository.name }} - # The signature this publish mints carries the `uses:` ref above in its - # certificate. Platform has independently approved this exact maintained - # revision for manifests, admission and node pulls. Other maintained - # revisions, tags and branches fail closed; a full SHA alone does not - # grant approval. The guard below checks only that the ref is a commit - # SHA, so an unapproved SHA still publishes, but its artifact never - # verifies in-cluster and the tenant silently stops reconciling. Get the - # new revision approved in Platform before changing this pin. - # - # Enabling the guard adds the producer-side half: the publish refuses to - # sign at all, before the build, so a tag or branch ref surfaces here as a failed - # release instead of as an artifact the cluster quietly rejects. - enable-caller-pin: true + contents: read # checkout and the default-branch fetch + packages: write # push the image and the manifests OCI artifact + id-token: write # keyless cosign signing as this workflow (GitHub OIDC) + steps: + - name: 🔒 Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit + - name: 📥 Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # required: publish-app refuses a persisted credential + # The action runs directly in this workflow, so the image and the manifests are signed as + # this repository's cd.yaml on the release tag (devantler-tech/monorepo ADR 0017). The + # platform trusts that identity, so a new action revision needs no platform approval. + - name: 📦 Publish signed application + id: publish + uses: devantler-tech/.github/actions/publish-app@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2 + with: + # publish-app pins the freshly built image digest into the container with this name. + # Keep that container's name equal to the repository name. + app-name: ${{ github.event.repository.name }} + # Relative to deploy/. The base/dev/prod split moves it to base/deployment.yaml. + app-manifest: deployment.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d675b8b..3b321e0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -215,7 +215,7 @@ jobs: # The portable pin contract ships from platform-tenant-template and is deliberately NOT # tenant-ignored, so it lands here on every sync. It validates immutable maintained - # callers, keeping release and template-sync aligned and the publisher independently approved. + # callers, keeping release and template-sync aligned and the publisher pinned to a tagged commit. # A caller reverting to a movable tag is the ordinary outcome of a hand edit or a bad merge, and it # is exactly what this guard refuses. The template's own scaffold contract already specifies this # wiring by name — a `workflow-caller-pins` job running the script, and required checks depending @@ -250,10 +250,10 @@ jobs: - name: 🔒 Validate the app container's read-only root filesystem run: sh scripts/readonly-rootfs.test.sh - # The platform deploys a release only when its publish-app.yaml revision is approved for this tenant. - # A PR that moves the pin to an unapproved revision would ship a release the platform refuses, so the - # template's check compares the base and head pins and fails the move here instead. An unchanged pin - # passes without contacting the platform. + # Releases are signed by this repository's own cd.yaml on the release tag (devantler-tech/monorepo + # ADR 0017), and the platform trusts exactly that identity. The template's check refuses a cd.yaml + # that leaves the minimal tag-only, credential-free frame those signatures rely on, and still holds + # back a move back to a shared publisher revision the platform has not approved for this tenant. publish-pin-approved: name: Publish Pin Approved runs-on: ubuntu-latest