Skip to content

Getting Started ​

KevinDeBenedetti/github-workflows is a library of reusable GitHub Actions workflows and composite actions. Callers stay minimal — CI steps run consistently across all your repos.

Prerequisites ​

  • A GitHub repository
  • Appropriate secrets set in your repo/org (see each workflow's docs)

How it works ​

Workflows are called with workflow_call and referenced from your own workflow files:

yaml
jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/<name>.yml@v0.57.0 # x-release-please-version

Pass a workflow only the secrets it declares (a secrets: block naming each one) and grant the calling job only the permissions its page lists — never secrets: inherit. A reusable workflow gets at most what its caller grants. See the security policy.

Pinning: the snippets of these pages are pinned to the latest release tag, and each release moves them. Pin to a release tag (@vX.Y.Z), the minor alias (@v0.<minor>) or a commit SHA, never to @main. The workflows call their composite actions with uses: $/…, resolved to the workflow's own commit, so a pin covers the actions too.

GitHub-hosted jobs run on ubuntu-26.04, a pinned image rather than ubuntu-latest: when GitHub moves ubuntu-latest to a new Ubuntu release, your jobs only change image with a release of these workflows, like any other change. A workflow with a runner input runs on any other label — another image (runner: '["ubuntu-24.04"]'), an arm64 runner or an Ubicloud runner (runner: '"ubicloud-standard-2"').

Important: All workflow files must live at the flat root of .github/workflows/. GitHub Actions does not support reusable workflows in subdirectories.


Quick start by stack ​

Node.js ​

yaml
# .github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-node.yml@v0.57.0 # x-release-please-version

Auto-detects pnpm or bun from your lockfile. Runs lint → typecheck → test → build. → Full reference


Python ​

yaml
# .github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-python.yml@v0.57.0 # x-release-please-version

Uses uv and ruff. Runs lint → format check → test. → Full reference


Shell scripts ​

yaml
# .github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-shell.yml@v0.57.0 # x-release-please-version

Runs ShellCheck → actionlint → Bats. → Full reference


Kubernetes ​

yaml
jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-kubernetes.yml@v0.57.0 # x-release-please-version
    with:
      kubeconform-paths: kubernetes/

Validates Kubernetes manifests with kubeconform (CRDs-catalog enabled by default).


Terraform ​

yaml
jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-terraform.yml@v0.57.0 # x-release-please-version
    with:
      tf-dir: terraform

Runs terraform validate and terraform fmt -check -diff.


Docker ​

yaml
jobs:
  deploy:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/cd-docker.yml@v0.57.0 # x-release-please-version
    permissions:
      contents: read
      packages: write      # push the image to GHCR
      deployments: write   # production/preview environment record
      id-token: write      # sign the image attestation (Sigstore)
      attestations: write  # store the attestation
    with:
      image-name: my-app
      tag-latest: true

Builds and pushes an image to GHCR (ghcr.io), for one or several platforms, on a GitHub-hosted or Ubicloud runner. → Full reference


Docs sync ​

Verify this repo's docs before the centralized docs site picks them up. The site polls public repos for docs/ changes on a schedule, so no token, App or secret is needed.

yaml
jobs:
  docs:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/cd-docs.yml@v0.57.0 # x-release-please-version
    with:
      docs-directory: docs

→ Full reference


Automated releases ​

yaml
jobs:
  release:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/release.yml@v0.57.0 # x-release-please-version
    # No token secret: release-please runs on GITHUB_TOKEN (enable "Allow
    # GitHub Actions to create and approve pull requests" in the repo settings).
    permissions:
      contents: write        # release branch, tags and releases
      issues: write          # release-please labels the release PR
      pull-requests: write   # open/update the release PR

Uses release-please. Automatically moves a v<major> tag after each release. → Full reference


Security scanning ​

yaml
jobs:
  security:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/security.yml@v0.57.0 # x-release-please-version
    permissions:
      security-events: write  # upload the Gitleaks and CodeQL results to code scanning
      actions: read           # code scanning reads the workflow run metadata
      contents: read

Combines Gitleaks secret scanning, CodeQL SAST, and optional dependency audits. → Full reference


PR descriptions (Claude Code) ​

Rewrites a managed block at the top of each pull request description on every push, from the commits and the diff. Runs on your Claude subscription: store a token from claude setup-token as the CLAUDE_CODE_OAUTH_TOKEN secret.

yaml
on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  describe:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/pr-description.yml@v0.57.0 # x-release-please-version
    permissions:
      contents: read
      pull-requests: write
    secrets:
      CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

→ Full reference


GHCR cleanup ​

Deletes old image versions in GHCR every week, from the repository that publishes them. Release tags, moving tags and images younger than 30 days are never deleted.

yaml
on:
  schedule:
    - cron: "23 4 * * 1"
  workflow_dispatch:

jobs:
  cleanup:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/cleanup-ghcr.yml@v0.57.0 # x-release-please-version
    permissions:
      packages: write
    with:
      packages: my-app   # default: the repository name
      dry-run: true      # remove once a manual run's log looks right

→ Full reference


Workflow runs cleanup ​

Deletes old workflow runs, with their logs and artifacts, every week. Runs younger than 30 days, the 10 most recent runs of each workflow and the runs of open pull requests are never deleted; a deleted workflow file leaves the Actions sidebar. artifacts-older-than-days also deletes the old artifacts of the runs kept, which count against the account's Actions storage.

yaml
on:
  schedule:
    - cron: "43 4 * * 1"
  workflow_dispatch:

jobs:
  cleanup:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/cleanup-runs.yml@v0.57.0 # x-release-please-version
    permissions:
      actions: write
      pull-requests: read
    with:
      artifacts-older-than-days: 3 # the runs kept lose their old artifacts too
      dry-run: true      # remove once a manual run's log looks right

→ Full reference


All available workflows ​

WorkflowDescriptionDoc
ci-node.ymlNode.js CI (lint → typecheck → test → build)→
ci-python.ymlPython CI (lint → format → test)→
ci-shell.ymlShell CI (ShellCheck → actionlint → Bats)→
ci-docs.ymlDocs CI (relative and external links, VitePress-safe Markdown)→
ci-kubernetes.ymlKubernetes CI (kubeconform on manifests, charts, kustomizations)→
ci-terraform.ymlTerraform CI (validate, fmt, tflint, config scan)→
ci-prometheus.ymlPrometheus CI (PromQL check + alert unit tests)→
ci-prek.ymlprek / pre-commit hooks run server-side (prek run --all-files)→
ci-docker.ymlBuild a Docker image without pushing it, with a read-only token→
cd-docker.ymlBuild & push a Docker image to GHCR, for one or several platforms→
cd-docs.ymlSync docs to a centralized docs repository→
release.ymlAutomated releases via release-please→
propagate-release.ymlA pull request in each consumer repository moves its pins to the new release→
renovate.ymlRenovate run with a GitHub App's token, on the shared preset KevinDeBenedetti/renovate-config→
security.ymlSecret scan + CodeQL SAST + dependency audit→
check-bot-commits.ymlGuard PRs against bot-authored commits→
pr-description.ymlPR description written by Claude Code on every push (Claude subscription)→
cleanup-ghcr.ymlScheduled GHCR retention: keeps releases and recent images, deletes the rest and old layer caches→
cleanup-runs.ymlScheduled workflow-run retention: keeps recent runs and the last runs of each workflow, deletes the rest, and optionally old artifacts→
cleanup-deployments.ymlScheduled cleanup of old deployment records, keeping the recent ones of each environment→

Composite actions ​

Actions can be used individually inside your own workflow steps:

yaml
steps:
  - uses: KevinDeBenedetti/github-workflows/.github/actions/setup-node@v0.57.0 # x-release-please-version
    with:
      node-version: '24'
ActionDescription
setup-nodeInstall Node.js + pnpm/bun with cache
setup-pythonInstall Python + uv with cache
shellcheckRun ShellCheck on all .sh files
batsRun Bats shell unit tests
detect-changesOutput a JSON matrix of changed apps in a monorepo
change-baseFind the commit a push or pull request's change starts from
secret-scanScan the commits a run brings with Gitleaks, with the config of a trusted commit
actionlintValidate GitHub Actions workflow files
kubeconformValidate Kubernetes manifests
tflintLint a Terraform module with tflint
config-scanScan infrastructure-as-code files for misconfigurations with Trivy
image-scanScan a container image for known vulnerabilities with Trivy
osv-scanAudit the dependencies of every lockfile with OSV-Scanner
check-commit-msgConventional Commits on commit messages (CI + commit-msg hook)
setup-claude-codeInstall the Claude Code CLI, pinned and checked against a SHA-256
install-toolInstall one of the tools the actions download, pinned and checked (internal)
setup-promtoolInstall promtool and yq, checked against their releases' SHA-256 lists (internal)
pr-descriptionWrite the PR description with Claude Code into a managed block of the PR body
check-docs-linksCheck for broken links in docs
check-docs-external-linksCheck the http(s) links of changed docs pages with lychee
check-vitepress-mdValidate VitePress markdown
notify-deploymentPost a deployment status notification
check-bot-commitsFail a pull request that brings commits of bots outside an allow-list
cleanup-runsDelete the old workflow runs of the repository, keeping the recent ones
cleanup-deploymentsDelete the old deployment records of the repository, keeping the recent ones of each environment
propagate-releaseOpen a pull request in each consumer repository that moves its pins to a release
move-release-aliasesMove the v<major> (and v0.<minor>) alias tags to a release
notify-release-reviewersRequest a review on the release PR from each listed user, once per user and PR
image-tagsImage name, tags and layer-cache reference of a container build

Examples ​

Complete ready-to-use caller files live in examples/:

FileStack
next.ymlNext.js
nuxt.ymlNuxt
vue-react.ymlVue / React (Vite)
fastapi.ymlFastAPI (Python)
monorepo.ymlMonorepo with change detection
pr-description.ymlPR descriptions written by Claude Code
cleanup-ghcr.ymlWeekly GHCR retention
cleanup-runs.ymlWeekly workflow-run retention
cleanup-deployments.ymlWeekly deployment-record retention