This repository is a sample demonstrating the combination of pinact and lefthook.
- pinact: A CLI tool to edit GitHub Workflow and Composite action files and pin versions of Actions and Reusable Workflows
- lefthook: Fast and powerful Git hooks manager for any type of projects
This repository shows how to automatically pin action versions in GitHub Workflow files during commits using Git pre-commit hooks.
git clone https://github.com/azu/pinhook
cd pinhook
make setupThis will install the necessary dependencies and set up the Git hooks.
When you modify .github/workflows/*.yml files and commit them, lefthook's pre-commit hook will trigger and pinact will automatically pin the action versions.
# Modify files in .github/workflows directory
git add .github/workflows/some-workflow.yml
git commit -m "Update workflow"
# pinact will automatically pin action versionslefthook.yml: Git hooks configurationMakefile: Installation and setup for pinact and lefthook