gha-validator
CLI tool to validate GitHub Actions workflows: outdated action versions, deprecated/unmaintained actions, unpinned mutable refs, missing permissions: blocks.
Install
Not yet published to PyPI. Install from source:
pip install git+https://github.com/Al1084/GitHub-Actions-Validator.git@v0.1.0
Usage
gha-validate .github/workflows/*.yml
SEVERITY CHECK FILE MESSAGE
-------- ----------------------- ------ ---------------------------------------------------------------------------------------------------------------------------
INFO outdated-action-version ci.yml jobs.build.steps[0]: `actions/checkout@v3` is outdated (v7.0.1 available).
WARNING unpinned-action ci.yml jobs.build.steps[1]: `actions/setup-node@main` is not pinned to a version or commit SHA.
INFO outdated-action-version ci.yml jobs.build.steps[2]: `actions/create-release@v1` is outdated (v1.1.4 available).
WARNING missing-permissions ci.yml Workflow does not declare a top-level `permissions` block.
WARNING deprecated-action ci.yml jobs.build.steps[2]: `actions/create-release` is deprecated. Archived by GitHub; use `softprops/action-gh-release` instead.
Output format
--format table|json|github, default table.
gha-validate --format json .github/workflows/*.yml
[
{
"check": "outdated-action-version",
"severity": "info",
"message": "jobs.build.steps[0]: `actions/checkout@v3` is outdated (v7.0.1 available).",
"file": "ci.yml",
"line": 7,
"fix": { "old": "actions/checkout@v3", "new": "actions/checkout@v7.0.1" }
},
{
"check": "unpinned-action",
"severity": "warning",
"message": "jobs.build.steps[1]: `actions/setup-node@main` is not pinned to a version or commit SHA.",
"file": "ci.yml",
"line": 8,
"fix": null
}
]
--format github emits workflow-command annotations that GitHub renders as inline PR annotations:
gha-validate --format github .github/workflows/*.yml
::notice file=ci.yml,line=7::jobs.build.steps[0]: `actions/checkout@v3` is outdated (v7.0.1 available).
::warning file=ci.yml,line=8::jobs.build.steps[1]: `actions/setup-node@main` is not pinned to a version or commit SHA.
::notice file=ci.yml,line=9::jobs.build.steps[2]: `actions/create-release@v1` is outdated (v1.1.4 available).
::warning file=ci.yml::Workflow does not declare a top-level `permissions` block.
::warning file=ci.yml,line=9::jobs.build.steps[2]: `actions/create-release` is deprecated. Archived by GitHub; use `softprops/action-gh-release` instead.
Auto-fix
--fix auto-bumps outdated version pins in place. Only affects outdated-action-version findings, scoped to the exact flagged line (won't touch an identical string sitting in a comment or elsewhere in the file).
gha-validate --fix .github/workflows/*.yml
fixed ci.yml: actions/checkout@v3 -> actions/checkout@v7.0.1
fixed ci.yml: actions/create-release@v1 -> actions/create-release@v1.1.4
Exit code is non-zero if any error-severity finding remains.
As a GitHub Action
- uses: Al1084/GitHub-Actions-Validator@v0.1.0
with:
paths: .github/workflows/*.yml # default
format: github # default; table|json|github
fix: "false" # default
No pip install step needed — the action installs itself from its own pinned ref.
Checks
outdated-action-version— a pinned version tag has a newer release availableunpinned-action— pinned to a mutable ref (@main,@master, a branch) instead of a version or commit SHAdeprecated-action— action is archived/unmaintained (seed list, growing)missing-permissions— workflow has no top-levelpermissions:block
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gha_validator-0.1.0.tar.gz.
File metadata
- Download URL: gha_validator-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a1a6d5a1999bc16f11407e68f613a4af58cd3d2038e487b4173bc5fa72f149
|
|
| MD5 |
ad978f15fa41f4cf384fabc04ee0c450
|
|
| BLAKE2b-256 |
9fc28bb62bf5c6bee46d77aeec81022ddc1e5bf67813a518dd01733d746cd415
|
File details
Details for the file gha_validator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gha_validator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0c9e4cfed45518463be1c8f40e410815d4b1d9ae106ffd4a4c0da3c2ce1b4f1
|
|
| MD5 |
aa34501d0fe0656c53e34964cc104445
|
|
| BLAKE2b-256 |
fcf9d0d3f4f1fd68b3b970e27673eedef13c5cc073fc04e32ea9c7c23f120ae8
|