GitHub action incorrect behavior
GG-HH opened this issue · comments
Environment
- ggshield version: 1.17.3
- in GitHub action
Describe the bug
GitHub action for secret scanning only scan the last commit when pushing multiple commits to a branch
Steps to reproduce:
- Create a repo with the GitHub action defined as stated in the documentation
- Create locally a branch with at least two commits, the first one containing example secrets.
- Push the commits
Actual result:
- The action is run
- The action scans the last commit (and displays that it has one commit to scan)
- The action does not fail because the last commit doesn't contain any secrets
Expected result:
- the action should scan all the newly pushed commits
- the action should fail because one of the commits contains secrets
An example can be found in one of my repos
Potential solution
I suspect that we use incorrect variables in the template. We should rely directly on the environment variables given here and eventually adapt our code. This should simplify the template for the GH action as well.
Other related considerations
CI commands for both SCA and IaC may be impacted by this problem and will require attention.