A tool to analyze GitHub Action dependencies in repositories and organizations, helping identify potential security risks from non-pinned action versions.
There's a report for the ethpandaops organization. This report is updated via the verify-org github workflow.
Using version tags like v1 or v2 in GitHub Actions can be risky as the action maintainer can change the underlying code of any tag, or branch. Pinning to specific commit hashes ensures you're using a specific, immutable version of the action.
- uses: actions/checkout@v3- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744- Scan entire GitHub organizations or specific repositories
- Identify GitHub Actions used in workflows
- Detect actions using non-pinned versions (tags vs commit hashes)
- Generate detailed HTML reports with security recommendations
- Provide recommended commit hashes for safer pinning
This will scan a specific repository and save the report to the current directory under ./reports. You'll see a .json and a .html file in the reports directory.
# Scan a specific repository and save the report to the current directory under ./reports
docker run --rm -it \
-e GITHUB_TOKEN=$(gh auth token) \
-v $PWD/reports:/reports \
ghcr.io/ethpandaops/github-actions-checker:master \
--repo ethpandaops/ethereum-helm-charts --output-dir /reportsNext you can use the previously generated report to dry-run a PR creation.
# Dry run a PR creation for the previous scan
docker run --rm -it \
-e GITHUB_TOKEN=$(gh auth token) \
-v $PWD/reports:/reports \
ghcr.io/ethpandaops/github-actions-checker:master \
create-pr --input /reports/ethpandaops-ethereum-helm-charts.json --repo ethpandaops/ethereum-helm-charts --dry-runIf you're happy with the changes, you can remove the --dry-run flag to actually create the PR. Note that for this you'll need to create a Personal Access Token (PAT) with the contents and workflow scopes. More info on how to create a PAT can be found here.
# Clone the repository
git clone https://github.com/ethpandaops/github-actions-deps-checker
cd github-actions-checker
# Build the binary
make build
# Or install it directly
make installSet your GitHub token as an environment variable:
export GITHUB_TOKEN=your_github_token
# Protip: If you have github cli installed, you can use it to get your token
export GITHUB_TOKEN="$(gh auth token)"./action-deps --org ethpandaops./action-deps --repo ethpandaops/ethereum-helm-charts./action-deps --org ethpandaops --include-archived./action-deps generate-html -i reports/ethpandaops-ethereum-helm-charts.json --output-dir reportsNote: You need to create a proper personal access token (PAT) for this one. If you're using the $(gh auth token) approach, that token won't have enought permissions.
Create a PAT under: https://github.com/settings/personal-access-tokens
Required scopes:
- Contents: Read and Write
- Workflow: Read and Write
The PRs will also include a Dependabot config file to ensure the actions are updated regularly. You can disable this by setting the --dependabot false flag. We do recommend to keep it enabled though.
This will show you what would be changed without actually creating a PR or a branch. Use the --dry-run flag.
./action-deps create-pr -i reports/ethpandaops-ethereum-helm-charts.json --repo ethpandaops/ethereum-helm-charts --dry-runThis will not create a PR, but will create a branch with the changes. Use the --skip-pr flag.
./action-deps create-pr -i reports/ethpandaops-ethereum-helm-charts.json --repo ethpandaops/ethereum-helm-charts --skip-prIf you don't have write permissions on the repo that you're targeting, you might want to fork it first and create a branch there.
You can do that simply by providing the --fork flag. This will create a fork of the repo in your GitHub account (the account that owns the PAT token that you're using) and create a branch there.
./action-deps create-pr -i reports/ethpandaops-ethereum-helm-charts.json --repo ethpandaops/ethereum-helm-charts --forkYou don't have to always specify the --repo flag. If you pass the --all flag, the tool will read the JSON file and create a PR for each repository listed in the file.
./action-deps create-pr -i reports/your-organization.json --allThis project is licensed under the GNU General Public License v3.0.
