GitHub Actions Digest Pinner is a tool to help you pin GitHub Actions to specific digests for better security and reliability.
- Finds and updates GitHub Actions references in your repository.
- Ensures all actions are pinned to specific digests.
Recommended: Just download the binary from the releases page.
-
Visit the releases page.
-
Download the appropriate binary for your operating system and architecture (e.g.,
github-actions-digest-pinner_linux_amd64.tar.gzfor Linux 64-bit). -
Extract the downloaded
.tar.gzfile:tar -xvzf github-actions-digest-pinner_<os>_<arch>.tar.gz
Replace
<os>and<arch>with your operating system and architecture. -
Move the extracted binary to a directory in your
PATH(e.g.,/usr/local/bin):sudo mv github-actions-digest-pinner /usr/local/bin/
-
Verify the installation:
github-actions-digest-pinner --version
You can also install the tool using go install, but note that the version command will not work because the
ldflags are not set during the go install process:
go install github.com/zisuu/github-actions-digest-pinner/cmd/github-actions-digest-pinner@latestRun the tool in your repository:
github-actions-digest-pinner update-
scan: Scans the repository for GitHub Actions workflows and lists the actions it would update.github-actions-digest-pinner scan --dir <directory> --verbose
-
update: Updates GitHub Actions workflows to use pinned digests.github-actions-digest-pinner update --dir <directory> --timeout 30 --verbose
The tool does not require configuration files but supports the following flags:
--dir: Specify the directory containing GitHub workflows (default: current directory).--verbose: Enable verbose output.--timeout: Set the API timeout in seconds (default: 30).
The tool provides detailed logs when run with the --verbose flag, including:
- Workflow files found.
- Actions parsed from each workflow file.
- Actions updated with their resolved digests.
If you encounter any issues, please report them on the GitHub Issues page.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a clear description of your changes.
See the CONTRIBUTING.md for more details.
This project is licensed under the MIT License.