Skip to content

Workflow python docker release

github-actions[bot] edited this page Oct 26, 2026 · 8 revisions

python-docker-release

What it does. The old name of container-release. It is a thin caller that forwards every input, the secret and the outputs to container-release.yml through a ./ reference, which GitHub resolves to the same commit as the workflow that contains it.

Why it exists. The release workflow named Python three times (its file name, its display name, and two egress hosts) while building whatever the Dockerfile builds. Renaming it would have broken every caller's pin. So the old file stayed and forwards; a caller pinned to it sees no difference.

Behaviour

  • A test holds the two sets of inputs identical, so a new input cannot be added to one and forgotten in the other.
  • Secrets do not cascade through nested workflows, so the thin caller forwards DOPPLER_TOKEN by name. The fixture reaches container-release.yml through it, so the nested reference is exercised on every pull request here.
  • The signing job's OIDC identity names the innermost workflow, so a --certificate-identity written out in full says container-release.yml; the --certificate-identity-regexp form matches either.
  • New callers should use container-release.yml. Move at the next pin bump.

A caller looks exactly like the one on the container-release page, with the old file name in uses:.

Inputs (35), read from python-docker-release.yml:

Input Type Default Meaning
dockerfile string Dockerfile Path to the Dockerfile.
context string . Build context.
platforms string linux/amd64,linux/arm64 Platforms for the published image.
image-name string empty Image name under ghcr.io. Defaults to the repository name, lower-cased.
push boolean false Publish. False builds, tests and scans only.
tags string type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha type=raw,value=latest,enable={{is_default_branch}} docker/metadata-action tag rules.
docker-test-command string empty Shell run against the locally built image; $IMAGE names it. Empty skips the check.
hadolint boolean true Lint the Dockerfile with hadolint before building.
hadolint-version string 2.15.1 hadolint release to download (hadolint/hadolint), without the v. Changing it means changing both hadolint-sha256-* inputs.
hadolint-sha256-amd64 string c7187db94eeeeca956519a6af171adc31453941a1e777961f6e680f697c8c507 SHA-256 of the hadolint-linux-x86_64 binary for that version.
hadolint-sha256-arm64 string f6198ef8090f404dbb771abfee086eb8c48ac177f30da7fd3510aca35b344b5d SHA-256 of the hadolint-linux-arm64 binary for that version.
hadolint-args string --failure-threshold warning Arguments passed to hadolint before the Dockerfile path, split on whitespace.
hadolint-continue-on-error boolean false Report hadolint findings without failing the job. For a repository adopting the linter before its Dockerfile is clean.
require-non-root boolean true Fail when the built image runs as root (id -u prints 0). The fix is a USER instruction in the Dockerfile. Needs an id binary in the image; turn it off for a distroless or scratch image.
probe-read-only boolean false Also run the image with a read-only root filesystem (--read-only --tmpfs /tmp) and fail if it breaks. Enable once the image is known to write only under tmpfs or volumes.
probe-command string empty Arguments for the read-only probe, which runs docker run --rm --read-only --tmpfs /tmp "$IMAGE" <probe-command> with the image's own entrypoint. Must exit on its own, such as --version. Required when probe-read-only is true.
dockerhub boolean false Also publish to Docker Hub when the Doppler config holds DOCKERHUB_USERNAME and DOCKERHUB_TOKEN.
dockerhub-repository string empty Docker Hub repository name (without the namespace). Defaults to the repository name, lower-cased.
sign boolean true Sign the published image with cosign (keyless).
sbom boolean true Generate an SPDX SBOM with syft and attach it as a cosign attestation.
provenance boolean true Record SLSA build provenance with GitHub Artifact Attestations.
trivy boolean true Scan the built image with Trivy and upload SARIF.
trivy-severity string CRITICAL,HIGH Severities Trivy reports.
trivy-exit-code string 1 Trivy exit code when findings exist. "1" (the default) makes findings fail the job; "0" reports only.
trivy-ignore-unfixed boolean true Skip advisories that have no fix in the distribution, so they do not block the gate.
trivyignores string empty Path to the caller's .trivyignore file, relative to the repository. Empty means none. Every entry needs a reason and a review date.
egress-policy string audit harden-runner egress policy - audit logs outbound connections, block allows only allowed-endpoints. Jobs that hold no secret follow egress-policy-secretless instead (EX-0001).
egress-policy-secretless string audit harden-runner egress policy for the jobs that hold no stored secret, no OIDC token and no write-scoped or publish-capable token (read-only contents, a SARIF upload at most), and whose output no privileged job consumes - exactly audit or block. Defaults to audit while security exception EX-0001 is active (GitHub-hosted runners in westus2 break harden-runner block; expires 2026-11-07 or when step-security/harden-runner#708 is fixed; see docs/security/exceptions/). Every job still has the default read-only job token. Set block to opt back in. Any other job follows egress-policy. Any other value fails the job.
allowed-endpoints string api.doppler.com:443 api.github.com:443 auth.docker.io:443 check.trivy.dev:443 deb.debian.org:80 files.pythonhosted.org:443 fulcio.sigstore.dev:443 get.trivy.dev:443 ghcr.io:443 github.com:443 index.docker.io:443 mirror.gcr.io:443 pkg-containers.githubusercontent.com:443 production.cloudfront.docker.com:443 pypi.org:443 raw.githubusercontent.com:443 registry-1.docker.io:443 rekor.sigstore.dev:443 release-assets.githubusercontent.com:443 timestamp.sigstore.dev:443 tuf-repo-cdn.sigstore.dev:443 harden-runner allow-list for block, space-separated host:port entries. The default is every endpoint this workflow's jobs reached in audit mode across the calling repositories; the runner's own infrastructure needs no entry. Wildcards are not supported and a newline-separated list matches nothing.
extra-allowed-endpoints string empty Appended to allowed-endpoints, for hosts only this repository reaches, such as an apt repository its Dockerfile adds. Same format.
doppler-project string empty Doppler project slug.
doppler-config string empty Doppler config slug holding CI secrets.
doppler-identity-id string empty Doppler Service Account Identity UUID for OIDC.
doppler-trusted-refs-only boolean true Fetch CI secrets only on the default branch, a version tag (vN.N.N) or a schedule; never on a pull request or another branch. false restores fetching on every same-repository run.
timeout-minutes number 60 Job timeout. Multi-arch builds that compile native code need a generous one.

Secrets a caller may pass, by name:

Secret Required Meaning
DOPPLER_TOKEN no Doppler Service Token fallback when OIDC is not configured.

Outputs a caller job can read:

Output Meaning
digest Digest of the published image index (empty when not pushed).
image The GHCR image reference by digest (empty when not pushed).

What it refuses to do

It adds nothing of its own: no job, no input and no behaviour that the container release does not have.

Clone this wiki locally