Skip to content

Commit

Permalink
Merge pull request #233 from step-security/int
Browse files Browse the repository at this point in the history
Do not create annotation if file under node_modules
  • Loading branch information
varunsh-coder authored Apr 22, 2022
2 parents ed2bdff + 9b88d8e commit 45df612
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eventhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ func (eventHandler *EventHandler) handleFileEvent(event *Event) {

if isFromDifferentProcess {
eventHandler.SourceCodeMap[event.FileName] = append(eventHandler.SourceCodeMap[event.FileName], event)
WriteAnnotation(fmt.Sprintf("StepSecurity Harden Runner: Source code overwritten %s syscall: %s by %s", event.FileName, event.Syscall, event.Exe))
if !strings.Contains(event.FileName, "node_modules/") { // node_modules folder has overwrites by design, even has .cs files in some cases. Need a better way to handle that
WriteAnnotation(fmt.Sprintf("StepSecurity Harden Runner: Source code overwritten %s syscall: %s by %s", event.FileName, event.Syscall, event.Exe))
}
}
}
}
Expand Down

0 comments on commit 45df612

Please sign in to comment.