A GitHub Action that catches risky Kubernetes changes before they ship, and checks that they landed well after.
- Pre-apply (
pull_request): scores the PR's rendered manifests against the base branch — weakened probes, removed PodDisruptionBudgets or NetworkPolicies, requests above limits, risky add-on settings and more — posts one sticky comment on the PR, and fails the check at or abovefail-on. - Post-deploy (
pushto your deploy branch): waits until Argo CD has deployed the commit, then passes or fails the job on how the deploy went (PASS/FAIL/INCONCLUSIVE/TIMEOUTin theverdictoutput).
Pre-apply works on its own, offline. Connect it to runtimez to add the cluster-aware checks — will the new pods fit on the target cluster, does the change clash with the add-on versions running there. Post-deploy always needs runtimez.
-
API key — in runtimez, create an API key with the
api:readscope. Its creator must be able to read the target cluster. -
Secrets — in the repository (or organisation) settings → Secrets and variables → Actions, add:
Secret Value RUNTIMEZ_URLyour runtimez API URL ( https://…)RUNTIMEZ_API_KEYthe rk_…key from step 1RUNTIMEZ_ORG_IDyour organisation id ( org_…)RUNTIMEZ_CLUSTER_IDthe cluster this repo deploys to ( cluster_…)Use secrets, not variables, for all four: GitHub prints a step's inputs in the run log, and a public repo's logs are public.
-
Workflows — copy
examples/pr-gate.ymland, if you deploy with Argo CD,examples/post-deploy-gate.ymlinto.github/workflows/, and pointmanifests,baseline-manifestsandargocd-appat your own paths and Application.
Every PR comment ends with one line saying whether the cluster-aware checks ran: on, off (and which input is missing or empty), or how many runtimez lookups failed and why. A missing or rejected key never fails the check, but it is never silent either — the line and a warning annotation say so.
With the cluster inputs set, the PR gate records its prediction for the PR's head commit, and the post-deploy gate links it to the commit Argo CD deploys (a merge or squash commit), so runtimez can score each prediction against what the rollout really did. Recording and linking need the key's creator to have write access to the cluster; when either fails the gate carries on unchanged.
The gate reads rendered manifests. For Helm or Kustomize, render the head and base sides in a step before it
(see the comment in examples/pr-gate.yml).
| Input | Mode | Default | |
|---|---|---|---|
mode |
both | pre-apply |
pre-apply or post-deploy |
manifests |
pre-apply | rendered YAML file or directory (required) | |
baseline-manifests |
pre-apply | the base branch's rendered manifests — turns on the diff checks | |
changed-files |
pre-apply | newline-separated git diff --name-only output |
|
fail-on |
pre-apply | HIGH |
LOW · MEDIUM · HIGH · CRITICAL |
github-token |
both | github.token |
pre-apply: posts the PR comment (needs pull-requests: write); post-deploy: finds the PR a commit came from (needs pull-requests: read) |
runtimez-url |
both | https:// (or http://localhost); required for post-deploy |
|
api-key |
both | rk_… key with api:read; required for post-deploy |
|
org-id |
both | required for post-deploy | |
cluster-id |
both | the target cluster | |
argocd-app |
post-deploy | <namespace>/<name> |
|
revision |
post-deploy | github.sha |
commit to wait for |
timeout |
post-deploy | 900 |
seconds before TIMEOUT |
gate-mode |
post-deploy | fast |
fast (Synced + Healthy) or full (also release verification) |
fail-on-inconclusive |
post-deploy | false |
fail the job when runtimez cannot judge the deploy |
@v1 follows the latest 1.x release; pin @v1.0.0 (or a commit SHA) for a fixed gate. Each release runs one
exact image, ghcr.io/runtimez-com/deployment-risk-action:<version> — never :latest.