Secure your CI/CD pipeline against supply-chain attacks on third-party GitHub Actions.
Scharf scans your workflows, identifies mutable action references, and replaces them with immutable commit SHAs. It also generates comprehensive CSV or JSON reports across repositories and lets you inspect available tags and SHAs without leaving your terminal.
Why Use Scharf?
By pinning every third-party action to a specific commit SHA, Scharf prevents unexpected or malicious changes from creeping into your CI/CD process. This ensures a stable and secure development lifecycle by eliminating risks tied to drifting dependencies and mutable tags.
third-party GitHub actions.
Key Features
Autofix Workflows: Detect and update mutable action tags to their corresponding SHAs in your workflow files.
Quick SHA Lookup: Retrieve the latest commit SHA for any GitHub Action directly from the CLI.
Actionable Reports: Produce JSON or CSV reports that highlight insecure references across one or many repositories.
Custom Scopes: Choose to scan only the current HEAD or include all branches when you audit or find actions.
Supported Platforms
Linux
Mac OSX
Installation
Option 1: Install quickly via HomeBrew (Needs Brew installed)
# Tap brew formula
brew tap cybrota/cybrota
# Install scharf
brew install scharf
Option 2: Download Prebuilt Binary
Visit the releases page and download the binary for your OS:
Include --dry-run to preview changes without modifying files:
scharf autofix git_repo --dry-run
2. Audit a Single Repository
Scan for mutable references in your current repository:
# Audit a local repository
scharf audit git_repo
# Audit a remote repository. This automatically clones remote to /tmp location with scharf-* prefix
scharf audit https_or_git_url
The output lists each insecure tag, its file location, and the SHA you should pin. You can pass --raise-error flag to return a Non-zero error code.
3. Find Across Many Repos
Point Scharf at a directory of cloned repositories to scan multiple projects:
scharf find --root /path/to/workspace --out csv
Add --head-only flag to limit scanning to each repo’s current HEAD, or omit it to include all branches.
4. List Available Tags and SHAs
If you need to explore versions before pinning, run:
scharf list owner/repo
# Ex: scharf list tj-actions/changed-files
This command prints a table of tags and their corresponding commit SHAs.
Mutable tags (e.g., @v1 or @main) allow action authors to push new code without changing your workflow. If a tag gets compromised, your CI can run malicious code. Scharf eliminates this vulnerability by always pinning to a specific, audited commit.
TODO for Scharf
Check Issues Tab on GitHub
Further Reading:
Supply Chain Compromise of Third-Party tj-actions/changed-files: