Skip to main content

Check and update GitHub Action versions in workflow files.

Project description

PyPI Python License

github-actions-version-check

A CLI tool to check and update GitHub Action versions in workflow files.

It scans .github/workflows, detects outdated uses: references, and can optionally rewrite them in place.


✨ Features

  • Detect outdated GitHub Actions (uses: owner/repo@ref)
  • Supports semantic version comparison
  • Safe updates within the same major version by default
  • Optional major upgrades (--allow-major)
  • In-place rewriting (--fix)
  • Pre-commit integration
  • XDG-compliant cache (with TTL) to reduce GitHub API calls
  • Works without a token (but supports GITHUB_TOKEN for higher limits)

📦 Installation

Using uv (recommended)

uvx github-actions-version-check

Using pipx

pipx install github-actions-version-check

🚀 Usage

Check workflows

github-actions-version-check

Exit codes:

  • 0 → everything is up to date
  • 2 → outdated refs found
  • 1 → error

Check a specific directory

github-actions-version-check /path/to/repo

Fix outdated versions

github-actions-version-check --fix

Allow major upgrades

github-actions-version-check --fix --allow-major

Show version

github-actions-version-check --version

⚙️ Configuration

Environment variables

Variable Description
GITHUB_TOKEN Optional GitHub token to avoid rate limits
GITHUB_ACTIONS_VERSION_CHECK_CACHE_TTL_DAYS Cache TTL (default: 7 days)
GITHUB_ACTIONS_VERSION_CHECK_NO_CACHE Disable cache

🧠 How it works

  • Scans .github/workflows/*.yml and .yaml
  • Extracts uses: lines
  • Resolves latest versions via GitHub API
  • Compares semantic versions
  • Optionally rewrites outdated refs

Supported patterns

uses: actions/checkout@v4
uses: owner/repo@v1.2.3

Limitations

  • Only simple uses: lines are supported
  • Multiline YAML (|, >) is not parsed
  • SHA-pinned actions are skipped

🔌 Pre-commit integration

repos:
  - repo: https://github.com/<owner>/github-actions-version-check
    rev: vX.Y.Z
    hooks:
      - id: github-actions-version-check
        args: [--fix]

🗂 Cache

Stored in:

$XDG_CACHE_HOME/github_actions_version_check/github-api.json

Fallback:

~/.cache/github_actions_version_check/github-api.json

🛠 Development

uv sync
uv run pytest
uv run mypy

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_actions_version_check-1.0.0.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_actions_version_check-1.0.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file github_actions_version_check-1.0.0.tar.gz.

File metadata

File hashes

Hashes for github_actions_version_check-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5d1b0763b765187af3675be30231afdf72085d89454117b3827670394acb7b4b
MD5 cf965bb8a24c73daf4e755273475630b
BLAKE2b-256 4c7f27df830e1b8681fc44ae347a654110bef4cde43ab3f36adb21cd00ee8d12

See more details on using hashes here.

Provenance

The following attestation bundles were made for github_actions_version_check-1.0.0.tar.gz:

Publisher: release-and-publish.yml on ilyachch/github-actions-version-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file github_actions_version_check-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for github_actions_version_check-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97b04784ddb0bf2f17d413bcd9808f85919fa31361e525f3ef6f488ce69cf4da
MD5 c9b16ccae8cfa87c7a6acc749a0da70d
BLAKE2b-256 b08d921b2328e3e34e0e72e23998c5413d7f91b9c1e87a925f54c5c2a06b89a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for github_actions_version_check-1.0.0-py3-none-any.whl:

Publisher: release-and-publish.yml on ilyachch/github-actions-version-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page