gitleaks / gitleaks-action

Protect your secrets using Gitleaks-Action
https://gitleaks.io
Other
305 stars 119 forks source link

Action not working on reusable workflows #120

Open mBlomsterberg opened 1 year ago

mBlomsterberg commented 1 year ago

When calling the gitleaks action from a reusable workflow the following error is received:

TypeError: Cannot read properties of undefined (reading 'commitSha')
    at /home/runner/work/_actions/gitleaks/gitleaks-action/v2.3.2/dist/index.js:70938:52
    at Array.forEach (<anonymous>)
    at Object.Write (/home/runner/work/_actions/gitleaks/gitleaks-action/v2.3.2/dist/index.js:70937:27)
    at start (/home/runner/work/_actions/gitleaks/gitleaks-action/v2.3.2/dist/index.js:71385:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Seems like the GITHUB_EVENT_PATH is working on the subworkflow event path.

bodgit commented 7 months ago

Are you calling the reusable workflow from an event other than a pull request?

I've just set up my reusable workflow to run on pull requests and it's working fine. I saw this issue and was expecting failure but it's behaving the same as a regular workflow.