diff --git a/.github/workflows/update-tuf-roots.yml b/.github/workflows/update-tuf-roots.yml new file mode 100644 index 0000000..310b8b8 --- /dev/null +++ b/.github/workflows/update-tuf-roots.yml @@ -0,0 +1,41 @@ +name: update-tuf-roots + +on: + workflow_dispatch: + schedule: + - cron: '0 10 * * *' + push: + branches: + - 'main' + +jobs: + update-tuf-roots: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v6 + - + name: Build + uses: docker/bake-action@v7 + with: + source: . + targets: tuf-root + env: + ROOT_SIGNING_VERSION: main + - + name: Commit changes + run: | + git add -A . + - + name: Create PR + uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 + with: + base: main + branch: bot/update-tuf-roots + commit-message: "chore: update tuf roots" + signoff: true + delete-branch: true + body: | + Update sigstore tuf roots to keep in sync with [https://www.github.com/sigstore/root-signing](https://www.github.com/sigstore/root-signing). + draft: false diff --git a/Dockerfile b/Dockerfile index fc03f3e..fd156f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,50 @@ -# syntax=docker/dockerfile:1.19-labs +# syntax=docker/dockerfile:1 ARG ALPINE_VERSION=3.22 -ARG ROOT_SIGNING_VERSION=main ARG GOLANG_VERSION=1.25 ARG XX_VERSION=1.8.0 -ARG DOCKER_HARDENED_IMAGES_KEYRING_VERSION=main + +ARG ROOT_SIGNING_VERSION=975f28e3597a34098a7c0c07edc16f47420b9aa3 + +ARG DOCKER_HARDENED_IMAGES_KEYRING_VERSION=04ae44966821da8e5cdcb4c51137dee69297161a + +FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx + +FROM alpine:${ALPINE_VERSION} AS base +RUN apk add --no-cache file git FROM scratch AS sigstore-root-signing ARG ROOT_SIGNING_VERSION -ADD https://www.github.com/sigstore/root-signing.git#${ROOT_SIGNING_VERSION} / +ADD --keep-git-dir=true "https://www.github.com/sigstore/root-signing.git#${ROOT_SIGNING_VERSION}" / FROM scratch AS tuf-root COPY --from=sigstore-root-signing metadata/root.json metadata/snapshot.json metadata/timestamp.json metadata/targets.json / COPY --parents --from=sigstore-root-signing targets/trusted_root.json / -FROM alpine:${ALPINE_VERSION} AS validate-tuf-root +FROM base AS tuf-root-update-work +RUN --mount=type=bind,target=/src \ + --mount=type=bind,from=sigstore-root-signing,target=/sigstore-root-signing \ + --mount=type=bind,from=tuf-root,target=/a \ + --mount=type=bind,source=roots/tuf-root,target=/b <